This is more of an annoyance rather than a showstopper. However, having to update JAVA_HOME is annoying because my JAVA is updated automatically. Here's what I know:
- Upon installing the extension, I received a message that JAVA_HOME was not detected.
- Investigating further, vscode-xml appears to use node-find-java version 0.2 to find JAVA home, when JAVA home is not set. This behavior is correct from my POV:
|
findJavaHome({ allowJre: true }, function (err, home) { |
|
if (err){ |
|
openJDKDownload(reject, 'Java runtime could not be located.'); |
|
} |
|
else { |
|
resolve(home); |
|
} |
|
}); |
- Investigating further, it appears to look in JavaSoft for JAVA_HOME (this is version 0.2, which is in the requirements):
https://github.com/jsdevel/node-find-java-home/blob/1f3dc4e5186dd434859ff6fffb0679feb1e47848/index.js#L61-L65
if(options.allowJre){
possibleKeyPaths = possibleKeyPaths.concat([
"SOFTWARE\\JavaSoft\\Java Runtime Environment",
]);
}
Here is the structure of my registry:

Yet, I still received this error message:

Adding this directly to user settings appears to resolve the problem:

The question is why this error happened, given that the extension should have found JAVA_HOME by itself. I am not currently set-up to debug vscode extensions, but I may tackle this if I have time.
This is more of an annoyance rather than a showstopper. However, having to update JAVA_HOME is annoying because my JAVA is updated automatically. Here's what I know:
vscode-xml/src/requirements.ts
Lines 69 to 76 in f5e2cdc
https://github.com/jsdevel/node-find-java-home/blob/1f3dc4e5186dd434859ff6fffb0679feb1e47848/index.js#L61-L65
Here is the structure of my registry:
Yet, I still received this error message:
Adding this directly to user settings appears to resolve the problem:
The question is why this error happened, given that the extension should have found JAVA_HOME by itself. I am not currently set-up to debug vscode extensions, but I may tackle this if I have time.