Since redhat-developer/vscode-java#2109 , vscode-java provides an embedded JRE on many common platforms. Since we depend on the extension, we should check whether the embedded JRE can be exists so we may use it for consistency. This should allow us to support users with no JRE.
The example at https://github.com/microsoft/vscode-java-test/blob/main/src/extension.ts#L41-L46 should work for us.
const javaLanguageSupport: Extension<any> | undefined = extensions.getExtension(ExtensionName.JAVA_LANGUAGE_SUPPORT);
if (javaLanguageSupport?.isActive) {
const extensionApi: any = javaLanguageSupport.exports;
if (!extensionApi) {
return;
}
...
...
The ExtensionAPI contains javaRequirements, which contains a reference to tooling_jre which is what we need.
Since redhat-developer/vscode-java#2109 , vscode-java provides an embedded JRE on many common platforms. Since we depend on the extension, we should check whether the embedded JRE can be exists so we may use it for consistency. This should allow us to support users with no JRE.
The example at https://github.com/microsoft/vscode-java-test/blob/main/src/extension.ts#L41-L46 should work for us.
The
ExtensionAPIcontainsjavaRequirements, which contains a reference totooling_jrewhich is what we need.