Require Java 17 for vscode extensions

This commit is contained in:
aboyko
2022-11-23 11:09:37 -05:00
parent c76044cf65
commit 06dd3a8f4d
5 changed files with 23 additions and 10 deletions

View File

@@ -155,16 +155,6 @@ export function activate(options: ActivatorOptions, context: VSCode.ExtensionCon
let javaExecutablePath = jvm.getJavaExecutable();
clientOptions.outputChannel.appendLine("Found java executable: " + javaExecutablePath);
let version = jvm.getMajorVersion();
if (version<11) {
VSCode.window.showErrorMessage(
`Spring Tools Language Server requires Java 11 or higher to be launched. Current Java ${javaExecutablePath}.\n
\n
(Note Java 8 can still be used in your own projects. Java 11 is only required to launch the Spring Tools Language Server process)`,
{}
);
return;
}
clientOptions.outputChannel.appendLine("isJavaEightOrHigher => true");
if (process.env['SPRING_LS_USE_SOCKET']) {

View File

@@ -47,6 +47,12 @@ export function activate(context: VSCode.ExtensionContext) {
synchronize: {
configurationSection: "bosh"
}
},
checkjvm: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {
let version = jvm.getMajorVersion();
if (version < 17) {
throw Error(`Bosh Language Server requires Java 17 or higher to be launched. Current Java version is ${version}`);
}
}
};
let clientPromise = commons.activate(options, context).then(client => client.start());

View File

@@ -47,6 +47,12 @@ export function activate(context: VSCode.ExtensionContext) {
scheme: 'file'
}
]
},
checkjvm: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {
let version = jvm.getMajorVersion();
if (version < 17) {
throw Error(`Concourse Language Server requires Java 17 or higher to be launched. Current Java version is ${version}`);
}
}
};
let clientPromise = commons.activate(options, context).then(client => client.start());

View File

@@ -40,6 +40,12 @@ export function activate(context: VSCode.ExtensionContext) {
scheme: 'file'
}
]
},
checkjvm: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {
let version = jvm.getMajorVersion();
if (version < 17) {
throw Error(`Cloudfoundry Manifest YAML Language Server requires Java 17 or higher to be launched. Current Java version is ${version}`);
}
}
};
commons.activate(options, context).then(client => client.start());

View File

@@ -30,6 +30,11 @@ export function activate(context: VSCode.ExtensionContext): Thenable<ExtensionAP
extensionId: 'vscode-spring-boot',
preferJdk: true,
checkjvm: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {
let version = jvm.getMajorVersion();
if (version < 17) {
throw Error(`Spring Tools Language Server requires Java 17 or higher to be launched. Current Java version is ${version}`);
}
if (!jvm.isJdk()) {
VSCode.window.showWarningMessage(
'JAVA_HOME or PATH environment variable seems to point to a JRE. A JDK is required, hence Boot Hints are unavailable.',