I have just transitioned into Visual Studio Code from Eclipse for Java. I want to create a simple HelloWorld folder which has src and bin folders. However, I do not know how to create the .classpath, .project, and .settings the same way Eclipse does it. How do I do this?
-
Visual Studio Code does not (and will not) use eclipse .classpath, project and .settings files. Why would you assume that it does?Elliott Frisch– Elliott Frisch2018-05-12 05:12:35 +00:00Commented May 12, 2018 at 5:12
-
Hello it says: Maven, Eclipse and Gradle Java project are supported through Language Support for Java(TM) by Red Hat, by utilizing M2Eclipse which provides Maven support and Buildship which provides Gradle support through the Eclipse JDT Language Server. code.visualstudio.com/docs/languages/java Regardless, how would I create a brand new Java Project with src and bin in Eclipse. I want to practice all the problems in LeetCode.Abhinav Rana– Abhinav Rana2018-05-12 05:19:31 +00:00Commented May 12, 2018 at 5:19
-
And here RedHat says "Recognizes projects with maven or gradle build files in the directory hierarchy." - the m2eclipse project provides maven support to eclipse; it's a plugin. It provides maven support to VS Code. Since you don't want to use maven, I can only suggest you want something else.Elliott Frisch– Elliott Frisch2018-05-12 05:23:55 +00:00Commented May 12, 2018 at 5:23
-
Alright, lol. I just wanted a simple way to write code haha. How would I even go about Maven or Gradle then? I just want to build, run, debug code. Is this possible?Abhinav Rana– Abhinav Rana2018-05-12 05:32:04 +00:00Commented May 12, 2018 at 5:32
-
Super simple way to write code: Download Netbeans and use it.markspace– markspace2018-05-12 05:33:55 +00:00Commented May 12, 2018 at 5:33
3 Answers
Hit Ctrl+Shift+P to show all commands, then type "Java" and select "Java: Create Java Project"
1 Comment
Visual Studio Code doesn´t have this orientation of creating a project because it´s file oriented. It´s on of the diferences with Visual Studio.
It means that creating a project structure is based on folders and files, and no file references and links the folders and files to a project. If you want to create a project with src and bin folders, you´ve to do it manually.
Comments
First you need install some packages for Visual Studio Code. You can find all in this Microsoft Support page: https://code.visualstudio.com/docs/java/java-tutorial
After you have installing it, you can press CTRL+SHIFT+P and type Java for get all commands.
In your case, for make a new project, follow these tips:
- Press keys:
CTRL+SHIFT+Pto open Command menu - Type:
Java: Create Java Project - Select a project type, like
No build tools - Select the project location
- Type the project name, like:
My first program - If appear the alert window, trust the authors of the files in this folder by pressing the button
Yes, I trust the authors
Now your project is created. You can see the folder src with the file App.java and the Hello World's code inside.
Now for testing your first program, press the right mouse button on App.java file and select Run Java
Now, if all works, your Hello World's program is printed on your Terminal window.

