question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 0.54 Not Using Global "java.jdt.ls.vmargs" Setting

See original GitHub issue

As of the latest 0.54 update, the java.jdt.ls.vmargs setting, if set globally (i.e., user settings), doesn’t seem to be used. I noticed this in my project because I use Project Lombok, and the global vmargs are set accordingly:

"java.jdt.ls.vmargs": "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:\"/home/vagrant/.vscode-server/extensions/gabrielbb.vscode-lombok-0.9.9/server/lombok.jar\"",

If I copy this exact setting and place it in my workspace/project folder (i.e., in .vscode/settings.json), Lombok annotations work as expected.

I’ve reverted back to 0.53.1, and it works as expected, utilizing the global java.jdt.ls.vmargs setting.

Environment
  • Operating System: Windows 7 w/ VS Code Remote, Connecting to Ubuntu 18.04
  • JDK version: openjdk version "1.8.0_222"
  • Visual Studio Code version:
  • Java extension version: 1.40.2
Steps To Reproduce
  1. Verify version 0.54 of the vscode-java extension is installed.
  2. Follow the instructions on vscode-java > Lombok Support, which may be just installing the Lombok extension for VS Code. Note this will require a reload/restart of VS Code.
  3. Open a Java project that utilizes [Project Lombok[(https://projectlombok.org/).
  4. Open any class that uses Lombok annotations, errors will appear relating to them (e.g., can’t find the log variable if using loggers)

You can then revert the vscode-java extension to 0.53.1, reload/restart VS Code, and the Lombok-related errors will disappear.

Logs

When viewing the server log, it seems to be picking up the setting when it’s global…so not sure what is happening behind the scenes that it’s not actually applying the setting?

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-12-04 14:56:42.050
!MESSAGE >>New configuration: {java={home=/usr/lib/jvm/java-8-openjdk-amd64, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:"/home/vagrant/.vscode-server/extensions/gabrielbb.vscode-lombok-0.9.9/server/lombok.jar"}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=false, updateBuildConfiguration=interactive, maven={userSettings=null}}, trace={server=messages}, import={maven={enabled=true}, gradle={enabled=true, wrapper={enabled=true}, version=null, arguments=null, jvmArguments=null, home=null}, exclusions=[**/node_modules/**, **/.metadata/**, **/archetype-resources/**, **/META-INF/maven/**]}, maven={downloadSources=false, updateSnapshots=false}, referencesCodeLens={enabled=false}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true, settings={url=null, profile=null}, comments={enabled=true}, onType={enabled=true}}, saveActions={organizeImports=false}, contentProvider={preferred=null}, autobuild={enabled=true}, maxConcurrentBuilds=1.0, completion={enabled=true, overwrite=true, guessMethodArguments=false, favoriteStaticMembers=[org.junit.Assert.*, org.junit.Assume.*, org.junit.jupiter.api.Assertions.*, org.junit.jupiter.api.Assumptions.*, org.junit.jupiter.api.DynamicContainer.*, org.junit.jupiter.api.DynamicTest.*, org.mockito.Mockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Answers.*], filteredTypes=[java.awt.*, com.sun.*], importOrder=[java, javax, com, org]}, foldingRange={enabled=true}, progressReports={enabled=true}, codeGeneration={hashCodeEquals={useJava7Objects=false, useInstanceof=false}, useBlocks=false, generateComments=false, toString={template=${object.className} [${member.name()}=${member.value}, ${otherMembers}], codeStyle=STRING_CONCATENATION, skipNullValues=false, listArrayContents=true, limitElements=0.0}}, selectionRange={enabled=true}}}
Current Result

Lombok annotations don’t work if configured globally per vscode-java > Lombok Support.

Expected Result

Lombok annotations work if configured globally, as seen version 0.53.1 of this extension.

Additional Informations

None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

5reactions
fbriconcommented, Dec 4, 2019

@chucknelson @ricmzn @bernardmo 0.54.1 has been pushed to the VS Code Marketplace, it should take a few minutes to be available for update in VS Code

2reactions
noschangcommented, Feb 27, 2021

Hi people. If you got to this issue, it’s possible that you are having the same problems that I was having. So, I’m leaving this link here and hope this can help you:

Lombok extension breaking vscode: https://github.com/GabrielBB/vscode-lombok/issues/54

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS code & java: This setting is deprecated, please use 'java.jdt ...
So what you need to do is to change your "settings.xml" to use "java.jdt.ls.java.home" as the property name instead of "java.home".
Read more >
redhat-developer/vscode-java - Gitter
I'm running vscode 1.71.1 with redhat-java (installed by Extension Pack for Java v0.25.2022090600) extension. I found my vscode won't formatt any java source ......
Read more >
Language Support for Java(TM) by Red Hat
The path to the Java Development Kit can be specified by the java.jdt.ls.java.home setting in VS Code settings (workspace/user settings). If not specified ......
Read more >
Java on Visual Studio Code FAQ and Wiki
How can I use Visual Studio Code with new Java versions? ... This is done by configuring the java.jdt.ls.vmargs setting in VS Code...
Read more >
VSCode Java (@VSCodeJava) / Twitter
Language support for Java ™ for Visual Studio Code, crafted with love by ... the absolute fastest way to get and setup a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found