vscode将java .class文件放在src文件夹中

发布于 2025-01-28 18:53:45 字数 621 浏览 1 评论 0原文

每当我运行main.java文件时,类文件都会生成我的bin文件夹到我的src文件夹。我已经尝试配置settings.json文件和设置“ java.project.outputpath” “ bin”。此后,我在命令调色板中进行了清洁Java语言服务器工作区,但仍然没有用。 我感谢所有帮助。谢谢。

”

Whenever I run my Main.java file, class files get generated into my bin folder and to my src folder. I've tried configuring the settings.json file and setting "java.project.outputPath" to "bin". After this, I did Clean Java Language Server Workspace in the Command Palette, but it still didn't work.
Id appreciate all and any help. Thank you.

Picture of bin and src

settings.json

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在你怀里撒娇 2025-02-04 18:53:45

这是由Java语言指定的。运行Java文件时,将在当前目录中自动生成类文件。

`"java.project.outputPath": "bin"`  
and
"java.project.sourcePaths": [
    "src"
],

在您的设置中。json表示使用此工作空间时,源路径中的Java文件将为您编译为类文件并存储在输出路径中。

您可以尝试删除所有.class文件并重新打开项目。您会发现所有类文件将自动加载在bin目录中。

This is specified by the Java language. When you run java files, class files will be automatically generated in the current directory.

`"java.project.outputPath": "bin"`  
and
"java.project.sourcePaths": [
    "src"
],

in your setting.json means when you use this workspace, the java file in the source paths will be compiled into a class file for you and stored in the output paths.

You could try to delete all .class files and reopen the project. You will find that all class files will be loaded automatically in the bin directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文