Search code examples
javavisual-studio-codejar

How to stop VSCode from changing the bin location of my Java project to somewhere in AppData when I try to add JAR files


this week I realized some new things about working with Java in VSCode, some projects had their bin location in AppData. I eventually fixed the problem, only to realize afterwards it was still happening, but only when I tried to add jar files to my project.

Here is a image of the command being run in a normal project. enter image description here

And here is a picture of my problem. enter image description here

This is a picture of my hierarchy.

enter image description here

And yes I have tried to set the bin location of my project in the settings.json in the .vscode folder.

enter image description here

I also added a launch.json but I don't know if its that important.

I really don't understand why this is happening, I don't use code runner, and I edited the classpath configuration here.

enter image description here

Thanks in advance for any help.


Solution

  • Because your project references the jar package. You can Ctrl + click the directory link to view the contents of the file, which is actually the command to use the jar package.

    enter image description here

    If there is no reference to the jar file, no temporary files will appear in the command.

    enter image description here

    And your configuration in setings.json is correct, it will specify that the generated .class file is in the bin folder of the current directory.

        "java.project.outputPath": "bin",