Reputation:
When I Create a new Project in Java, I don't get a package and when I manually create it, the Classpath changes.
Upvotes: 0
Views: 1644
Reputation: 9481
Creating a package in VS Code is equivalent to create a folder, then every time you create a .java file under the package folder, there will be a statement package name;
added automatically on the top line. If not, please add it manually to avoid compilation error.
About Classpath, you can get it with the function this.getClass().getResource("/").getPath()
, which is already shown in execution scripts:
You can see that the Classpath was the same one and not changed.
Upvotes: 1