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.

Add support for workspace specific java.home that use vscode variables

See original GitHub issue

In the workspace specific settings.json,

Does not work: "java.home": "${workspaceRoot}/java/jdk64"

Works: "java.home": "D:/dev/proj-1/java/jdk64" works.

Environment
  • Operating System: Windows
  • JDK version: 8
  • Visual Studio Code version: 1.31.1
  • Java extension version: 0.38.0
Steps To Reproduce
  1. Open a workspace
  2. Create a folder named .vscode
  3. Create a file in the folder named settings.json
  4. Try the setting above that does not work by adding it to settings.json

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

2reactions
srl295commented, Dec 2, 2021

Any update on this? Also, variables work in java.test.config:

    "java.test.config": [{
        "name": "cldrtest",
        "workingDirectory": "${workspaceFolder}",
        "vmargs": [
            "-DCLDR_DIR=${workspaceFolder}",
            "-DCLDR_ENVIRONMENT=UNITTEST"
        ]
    }],

… but not in vmArgs:

{
    "java.debug.settings.vmArgs": "-DCLDR_DIR=${workspaceFolder}",
}
1reaction
hannah23280commented, Jan 19, 2021

I think someone has just released an extension to parse variable in settings. Hope vscode-java exntesions developer can consider using it to support relative path for “java.home”, etc https://www.npmjs.com/package/vscode-variables

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing the java.home path in VS code - Stack Overflow
The 'java.home' has the highest priority, and 'java.home' is different from the system environment variable. Open settings and search ...
Read more >
Variables reference - Visual Studio Code
The following predefined variables are supported: ${userHome} - the path of the user's home folder; ${workspaceFolder} - the path of the folder opened...
Read more >
Java with Visual Studio code (Vscode) Part 1 | by Tariqul Islam
For Mac os X · Run the Command /usr/libexec/java_home -v it will gives you the home directory where the JDK is installed. ·...
Read more >
Setup VS Code for Java development - Rob O'Leary
To use Java within Visual Studio Code, you need to install a Java ... add the location of the installed JDK to the...
Read more >
How to set up Java in Visual Studio Code! - YouTube
Hello and welcome to the Java introduction video with Visual Studio Code ! In this video we go through installing java, setting up...
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