Require Java 17 for vscode extensions
This commit is contained in:
@@ -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']) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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.',
|
||||
|
||||
Reference in New Issue
Block a user