vscode-java
vscode-java copied to clipboard
When opening Java Project, the Java Build Status is spinning forever.
[provide a description of the issue]
Environment
- Operating System: Windows 10
- JDK version: JavaSE-1.8 (for the project) and JavaSE-11 for vs code
- Visual Studio Code version: 1.70.0
- Java extension version: Extension Pack for Java v0.25.0
Steps To Reproduce
- Open Java Project
- The Java Build Status indicator on the status bar is spinning forever.
- The status bar Java Build status shows an
info popup as "Building - Lightweight mode".
[Please attach a sample project reproducing the error] I don't have a sample project now. Will try to make a simple one to verify.
Please attach logs vscode-java logs: vscode-app-1660164678368.log Another log: vscode-app-1660165168557.log Java Language Server's workspace logs: .log
Current Result
Java build status is spinning and the project is not loaded
Expected Result
The project was opening and compiling correctly just last week. I think the recent update broke something.
Additional Informations
The project was opening and compiling correctly just last week. I think the recent update broke something.
workbench.desktop.main.js:2279 Error: Header must provide a Content-Length property.
@tarekahf Your issue is duplicated with https://github.com/redhat-developer/vscode-java/issues/2577#issuecomment-1208922149, pls take a look at the workaround there.
@tarekahf i have a problem like you, try this https://github.com/redhat-developer/vscode-java/issues/2577#issuecomment-1208922149 working on me
Thanks all for the reply... Was that magic or what? It worked. I'll wait for tomorrow to confirm. Then you can close. I'll check it using another WiFi connection...
We're also interested in how this happens and see whether we could add that vmArgs on Java extension by default.
Just a quick question about the message I saw about lightweight mode for Java projects. Is there a heavyweight mode and what's the difference? Can you please share a link for details?
Here is the document about lightweight mode. https://code.visualstudio.com/docs/java/java-project#_lightweight-mode
I'm having the same issue, but the workaround mentioned doesn't fix my problem. I have no code even in my project yet. just a basic pom importing two aws dependencies. This just started sometime in the last week. I'm on version 1.70.1. It always seems to get stuck in the "download sources and javadoc" line. that never gets to 100%. it gets to various percentages between 0 and 100 and then just stops.
I'm having the same issue, but the workaround mentioned doesn't fix my problem. I have no code even in my project yet. just a basic pom importing two aws dependencies. This just started sometime in the last week. I'm on version 1.70.1.
![]()
For me the problem was resolved but I will wait until this one is also solved. I have another project that uses maven so I'm going to test it out.
I wish there was a way to revert the language server, and not have it auto update.
Until this is fixed, vscode is basically notepad for me. nothing works except typing in code.
I am also facing the same issue. Mine is maven project.
@shivamfet could you provide a project example?
Hi @snjeza
Following is the snapshot of project outline, it is a maven project. Hope it helps
This is the remote-settings.json file
`{
"java.jdt.ls.java.home": "/usr/java/jdk-17.0.2",
"java.jdt.ls.vmargs": "-Xlog:jni+resolve=off",
"java.dependency.syncWithFolderExplorer": true,
"http.proxy": "...",
"http.proxyStrictSSL": false,
"maven.executable.path": "...",
"maven.settingsFile": "...",
"maven.executable.options" : ".....",
"files.exclude": {
}
}`
Hi @snjeza
Developer Tools log says:
mainThreadExtensionService.ts:79 [[object Object]]Header must provide a Content-Length property. $onExtensionRuntimeError @ mainThreadExtensionService.ts:79 mainThreadExtensionService.ts:80 Error: Header must provide a Content-Length property. at p.onData (/home/skakkar/.vscode-server/extensions/redhat.java-1.9.0/dist/extension.js:2:1052283) at Socket.<anonymous> (/home/skakkar/.vscode-server/extensions/redhat.java-1.9.0/dist/extension.js:2:1052004) at Socket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at Pipe.onStreamRead (node:internal/stream_base_commons:199:23) $onExtensionRuntimeError @ mainThreadExtensionService.ts:80 mainThreadExtensionService.ts:79 [[object Object]]Header must provide a Content-Length property. $onExtensionRuntimeError @ mainThreadExtensionService.ts:79 mainThreadExtensionService.ts:80 Error: Header must provide a Content-Length property. at p.onData (/home/skakkar/.vscode-server/extensions/redhat.java-1.9.0/dist/extension.js:2:1052283) at Socket.<anonymous> (/home/skakkar/.vscode-server/extensions/redhat.java-1.9.0/dist/extension.js:2:1052004) at Socket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
@shivamfet What OS are you using?
Hi @snjeza
My vscode is installed on MAC OS Monterey version 12.1.
I am doing remote development and remote development box is Linux x64
Thanks Shivam
Hi @snjeza Sorry to bug you again. Any pointers or workaround if you can suggest it will be really helpful.
Regards Shivam
@shivamfet I'm working on it.
A related issue - https://github.com/redhat-developer/vscode-java/pull/2646
@shivamfet Could you check https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix ? It includes https://github.com/redhat-developer/vscode-java/pull/2646/
You should remove
"java.jdt.ls.vmargs": "-Xlog:jni+resolve=off",
It will be added automatically
@shivamfet Could you check https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix ? It includes #2646
You should remove
"java.jdt.ls.vmargs": "-Xlog:jni+resolve=off",
It will be added automatically
I have opened an old project which is maven-based using vscode. I am 100% sure it was working fine several months ago. No, it is not working. I see the build status indicator spinning forever on the status bar.
Update: I added the fix below to the settings file and it worked fine now:
"java.jdt.ls.vmargs": "-Xlog:jni+resolve=off"
Try to open this repo in vs code: https://github.com/javalite/jar-explorer
The above is a sample project that uses maven.
@tarekahf What version of VS Code are you using?
@tarekahf What version of VS Code are you using?
I got the following from vs code help/about:
Version: 1.70.2 (user setup) Commit: e4503b30fc78200f846c62cf8091b76ff5547662 Date: 2022-08-16T05:35:13.448Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.19042
@tarekahf Could you try to install https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix
@tarekahf Could you try to install https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix
But why? it's working for me now.
But why? it's working for me now.
"-Xlog:jni+resolve=off" will be added automatically. See https://github.com/redhat-developer/vscode-java/pull/2646
You mean if I download this
https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix
Then the settings
"-Xlog:jni+resolve=off"
will be added automatically?
Will this happen for existing project, new project, or both? Will it apply For maven based project, no-build tool project, or both?
will be added automatically?
Right!
Will this happen for existing project, new project, or both? Will it apply For maven based project, no-build tool project, or both?
It should be added always.
will be added automatically?
Right!
Will this happen for existing project, new project, or both? Will it apply For maven based project, no-build tool project, or both?
It should be added always.
Please bear with me as I cannot afford to mess up with my vs code setup.
So, you are saying that this download:
https://github.com/snjeza/vscode-test/raw/master/java-1.10.0.vsix
Is an updated version for vscode and will fix the problem of Java Build Status spinning forever.
But what will happen to my current stable vs code setup? will it override my current vs code installation?
But what will happen to my current stable vs code setup? will it override my current vs code installation?
@tarekahf you can wait for the stable VS Code 1.10.0 release - https://github.com/redhat-developer/vscode-java/pull/2648