javaVSCode icon indicating copy to clipboard operation
javaVSCode copied to clipboard

jdkPath could be moved to settings.json instead of launch.json

Open jakoberzar opened this issue 7 years ago • 1 comments

Wouldn't moving the jdkPath property to settings.json make more sense?

I don't exactly use Java daily, but I often need to open a new folder, and if I want to debug it with this extension, I need to create a new launch.json of course, and then search for the jdk path so I can add it to config. It gets a bit tedious to do that for every single project, when I know the path will mostly stay the same. There is no official "nice" way to have a global launch.json at the moment (only to put a launch object into user settings, but even then it doesn't work with the language specific settings - [java], and it says "Unknown configuration setting", so it seems kind of hacky). Also, every extension I remember sets paths like these from settings.json.

In order to not break current configs, perhaps the extension could look in "launch.json" first and in "settings.json" if it doesn't find it?

jakoberzar avatar Mar 25 '17 16:03 jakoberzar

You can use environment variable JAVA_HOME in launch.json like "jdkPath": "${env:JAVA_HOME}/bin",

faustinoaq avatar Jun 10 '17 16:06 faustinoaq