vscode-java
vscode-java copied to clipboard
VSCode reloads Java projects on each startup which takes a very long time
I am in the process of switching from Eclipse to VSCode for Java Development - so far, I have been able to setup a workspace folder with all my Java projects in it and all works fine.
However, every time I restart VSCode, all projects are rebuilding (showing me "Opening Java Projects: check details") which takes a very long time (about 5 minutes) - in comparision, when I am re-opening my Eclipse workspace with the same amount of projects, it only takes ~30 seconds for everything to be ready. Is there something I am doing wrong or can't VSCode "remember" Java projects as good as Eclipse?
@xxc-zsz What OS are you using? Do you use maven, gradle?
Hi @snjeza I had a similar problem, but my situation was that the build stalled. This issue affects other features of VSCode (such as Source Control) If I disable "Language Support for Java(TM)" extension, source control works fine. This problem had begun in the last few days
Maven project VSCode: v1.70.2 Language Support for Java(TM): v1.9.0
Hi @snjeza I had a similar problem, but my situation was that the build stalled. This issue affects other features of VSCode (such as Source Control) If I disable "Language Support for Java(TM)" extension, source control works fine. This problem had begun in the last few days
Maven project VSCode: v1.70.2 Language Support for Java(TM): v1.9.0
I found https://github.com/redhat-developer/vscode-java/issues/2577#issuecomment-1208922149 can solve my problem. Sorry, i miss this issue.
@xxc-zsz Did you still observe the problem with the latest pre-release? There are several fixes regarding perf done recently.
You can click this button to turn on the pre-release channel
I have same problem here... I run vscode server in docker container. It took more than 5 minutes for loading java project...
System used: Host: ubuntu 22.04 Docker Image: ubuntu 20.04 VSCode: 1.74.1 Language Support For Java: 1.13.0 Java on Docker: OpenJDK 11.0.17
I am experiencing the same problem running in a devcontainer. The project does not even contain much Java, it is mostly used to build things with maven.
Host: MacOs (aarch64) Docker image (devcontainer): bullseye VS Code: 1.74.2 Language Support For Java: 1.13.0 openjdk version "17.0.5" 2022-10-18 LTS
My initial thought was, that file I/O on docker on macOs is not the fastest. This can be improved by making the used folder a volume. Can someone tell me, what folder this extension puts its index in (assuming the indexing of the project is the slow part)?
I tried the pre-release version, did not noticeably differ wrt this issue. The task seems stuck on one item when reading the saved build state. Once that is done, it finishes almost instantly.
14c87596 Repository registry initialization [Done]
8dfb9fde Importing Maven project(s) [Done]
00df47a1 Synchronizing projects [Done]
3c3fe080 Synchronizing projects [Done]
25a05498 Background task: 50% Reading saved build state for project XXX [495/1000]
I'm facing the same problem and switched back to eclipse. Any update on this issue?
In eclipse, it take less than a minute to load several huge java projects and you are ready to run the tests. But, in vscode, you have to wait until you see the thumbs up icon in the status bar, which can take between 2 to 5 minutes for one maven project with 5 relatively large modules. During the loading process, nothing works like intelisens, running tests... etc.. You have to sit and wait...
@GourabIX @tarekahf Could you, please, provide a project example?
I am facing the same problem, any update regarding this issue?
@jcgaming-official You can try to set
"java.jdt.ls.vmargs": "-Daether.dependencyCollector.impl1=df <your VM args",
to your settings.json. Could you provide a project example?
Try this project to reproduce the issue:
https://github.com/javalite/jar-explorer
Everytime you open the project, open a Java source file and watch how the code is being compiled. This is a small project so compilation might finish quickly. But, it will always compile and you can click on view details to see the progress in the terminal window.
Let me if you need more information...
facing the same issue, at first vs code opened projects very fast like 1 or 2 mins, don't know what happened after updating in oct/ nov in 2023, every time i open java project in vscode, it is taking like 20 mins to load all the projects.
facing the same issue, at first vs code opened projects very fast like 1 or 2 mins, don't know what happened after updating in oct/ nov in 2023, every time i open java project in vscode, it is taking like 20 mins to load all the projects.
You mean Oct/Nov 2022?
my bad, yes that is 2022
I am still facing this issue on Oct / Nov 2023 on Fedora. My Java spring boot projects are cleaned on startup causing protobuf generated sources to be not present in maven submodule, which then shows redlines all over the place on other submodules which depend on it.
I'm always facing the same problem. It takes about 7 minutes to load and run the unit test in VS code. In eclipse, for the same project, it takes 40 seconds.
@overtomanu @tarekahf Could you, please, provide a project example?
@overtomanu @tarekahf Could you, please, provide a project example?
I already provided one, see my previous post above. I'll try to make a screen recording for both.
@snjeza I have opened around 8 to 10 work related projects. These projects are spring boot projects with some of them having proto files, nothing out of the ordinary. I will try to get sample project's to reproduce this issue when i get time.
I also have problems here please improve this it takes 35 min each time to load the project, and I need to use lightweight mode but then I cannot debug it's so annoying @jdneo I use the pre-release version
I also have problems here please improve this it takes 35 min each time to load the project, and I need to use lightweight mode but then I cannot debug it's so annoying @jdneo I use the pre-release version
I found a solution and it us the best. To fix this issue, just switch your OS into Linux. Yes I am using that now and it's open smoothly
I'm facing the same problem. I have about 70 java projects and it's taking more than 35 minutes. Not sure why it has to reload everything. It should just be reloading the deltas.
@cervantesandres Could you try VS Code Pre-Release? It includes the fix for https://github.com/redhat-developer/vscode-java/issues/3637
@snjeza Could you clarify what you're referring to by "VS Code Pre-Release"?
Select the pre-release vscode-java version
@fbricon @snjeza Switching to Pre-Release didn't resolve the issue; Java building still takes around 35 minutes. Seems like every class is getting compiled when the plugin opens
@cervantesandres Could you try the steps from https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/3150#issue-2279821730? Step 6 (building) is the same, but step 7 (reloading) has improved significantly.
@snjeza to clarify, you want me to try these 7 steps?
to clarify, you want me to try these 7 steps?
Yes. You should use your project instead of quarkus-langchain4j