2

I have some problem in visual studio code :

  1. Visual studio code for java not create folder bin, file .classpath, .project and .settings automatically. Sreenshoot : In explorer VSC

  2. File app.java and app.class in the same folder (src), when I look tutorials in youtube, file .class should be in bin folder.

  3. In settings.json there is file.exclude, when I change .classpath to the false or delete it. It always reset to the true again. But if I run my code. it works. Screenshoot : settings.json file (user)

Can someone help? I've search in any forum but never found solution and make sure path in my environment is correct!

Windows 10, VSC 1.53.0, jdk 15 (latest)

Edited

I ask this question when I'm very new with Java, now I understand, some file like .classpath, .project and etc will show when I use build tools like gradle or maven. Maybe because tutorial on youtube use old vscode version and not explain more about this file, actually this is like dumb question. But maybe this can help someone that new in Java too

2 Answers 2

3

If your project is newly created in VS Code through the command Java: Create Java Project.... This command will create a new project without build tools. (No Maven and Gradle). In that case, the files such as .classpath, .project, etc... will be hidden in the workspace storage path, which is by design, since we want the user just focus on the code itself.

If you want to see the bin folder, there is a setting called java.project.outputPath, you can set a relative path to that setting, then the output folder will be explicitly show in your project. For example: "java.project.outputPath": "bin"

Note, the setting java.project.outputPath only takes effect in the workspace scope.

Sign up to request clarification or add additional context in comments.

1 Comment

Could you share more details about why you want to show these files?
0

I'm not interested at the youtube tutorials, but the folder structure in vscode-java is indeed like what you see.

In integrated Terminal, there'll a series of execution scripts shown before the real output. The one ends of folder bin is also the current project's classpath. The .class files which is generated by being compiled are stored there.

Setting.json is stored under the folder .vscode. This is your workspace setting, which is generated by pressing Ctrl+, and choosing workspace.

enter image description here

2 Comments

[Running] cd "c:\Users\asus\Documents\Sasmita\Coding\Java\javaku2\src\" && javac App.java && java App Hello, World! My output is shown like that
Uninstall the extension Code Runner, cause i run the java file from the button provided by java extension pack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.