'how to create java project with command?

I'm a beginner, when I create a java project using the command pallate in vscode ctrl-shift-p -> java: Creat java project, only created the lib, src and readme files, I see on the vscode website there must be a .settings, bin, src folder .classpath .project

is there anything to configure again? thank you

my create project

create project on vscode web



Solution 1:[1]

Those files you mention (.settings, .classpath, .project) are just metadata files from the IDE, and java does nothing with them, they are not part of a java project, the only thing you need to create a java program its a .java file. If you want to create a project, there are better ways, for example using maven https://maven.apache.org once you installed it, you can create a new project using the QuickStart archetype

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4

It will create a standard structure for your project, and will save you a lot of work with the structure of your project, dependencies and build configurations.

Solution 2:[2]

To store project metadata some IDEs use additional files:

  • Eclipse uses .settings, .project, .classpath
  • Intellij uses .idea, .iml, .ipr, .iws

You don't need any of these for your project to work. If you use VSCode you don't need them at all.

Most modern java frameworks have quite comprehensive code generators for new projects which makes it easier to get started e.g.:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 petrubear
Solution 2 Simon