简体   繁体   English

Java vscode 项目无法正常工作

[英]Java Project for vscode doesn't works fine

Whenever I create a new maven project in vscode, the Java Project extension doesn't update as the file explorer does, so I have to manually clean the workspace caches to make it synchronized.每当我在 vscode 中创建一个新的 maven 项目时, Java 项目扩展不会像文件资源管理器那样更新,所以我必须手动清理工作区缓存以使其同步。 Also, the only file category I could add in Java Project view is the.class files, so I have to quire with the explorer.此外,我可以在Java 项目视图中添加的唯一文件类别是 .class 文件,因此我必须使用资源管理器进行查询。 In some cases, suppose I need to add the same file in two or more nested folder like src and target, which is confusing, it' s never the case in eclipse and other refined editors for java, is there a way to solve these two problems?在某些情况下,假设我需要在两个或多个嵌套文件夹中添加相同的文件,如 src 和 target,这很混乱,eclipse 和 java 的其他精制编辑器从来没有这种情况,有没有办法解决这两个问题?

I will publish my operation steps in the answer.我会在答案中公布我的操作步骤。 You can also refer to the official documents for more information on project management也可以参考官方文档了解更多关于项目管理的内容

  1. Creat java project创建 java 项目

在此处输入图像描述

  1. Creat a new floder to save Maven新建一个floder保存 Maven

在此处输入图像描述

  1. Vscode automatically generates Maven project and workspace environment vscode自动生成Maven项目和工作区环境

在此处输入图像描述

There is no need to empty the workspace.无需清空工作区。 Of course, if you want to create a project in the original directory, it may cause similar problems.当然,如果你想在原来的目录下创建工程,也可能会出现类似的问题。

For your second question, I think java project only manages Java classes.对于你的第二个问题,我认为 java 项目只管理 Java 个类。 If you want to put other file types, why not use file explorer.如果你想放其他文件类型,为什么不使用文件资源管理器。

Java project has its own things to do Java 项目有自己的事情要做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在邮递员 api 中工作正常,但在 java 中却没有 - In postman api works fine but in java it doesn't Java 项目在 Inteliji 中运行良好,无法在 VSCode 中编译 - Java project which runs fine in Inteliji, can't compile in VSCode 可运行的Jar文件不起作用,但是源代码可以正常工作。 Maven项目JavaFX - Runnable Jar file doesn't work but the source code works fine. Maven Project JavaFX 为什么opennlp库的HelloWorld在Java上工作正常,但不适用于Jruby? - Why the HelloWorld of opennlp library works fine on Java but doesn't work with Jruby? Java应用程序在Eclipse上工作正常,但在部署为可运行的jar后它无法正常工作 - a Java application works fine on Eclipse but it doesn't work properly after being deployed as a runnable jar C ++代码可以正常工作,但从Java(JNI)调用时不起作用 - C++ code works fine but doesn't work when calling from Java (JNI) Toast在实际设备上不起作用,但在模拟器上可以正常工作 - Toast doesn't works on real device but works fine on emulator VSCode Java项目中无法导入包 - Can't import packages in VSCode Java project Java程序运行正常但不编译 - Java program runs fine but doesn't compile VBA连接正常,但Java没有 - VBA connects fine but java doesn't
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM