PT #153612030 Don't show tools.jar message for Java 9
This commit is contained in:
@@ -33,7 +33,7 @@ export interface ActivatorOptions {
|
||||
clientOptions: LanguageClientOptions;
|
||||
launcher: (context: VSCode.ExtensionContext) => string;
|
||||
jvmHeap?: string;
|
||||
classpath?: (context: VSCode.ExtensionContext) => string[];
|
||||
classpath?: (context: VSCode.ExtensionContext, javaVersion: number) => string[];
|
||||
}
|
||||
|
||||
export function activate(options: ActivatorOptions, context: VSCode.ExtensionContext): Promise<LanguageClient> {
|
||||
@@ -98,7 +98,7 @@ export function activate(options: ActivatorOptions, context: VSCode.ExtensionCon
|
||||
'-Dorg.slf4j.simpleLogger.logFile=' + logfile
|
||||
];
|
||||
if (options.classpath) {
|
||||
const classpath = options.classpath(context);
|
||||
const classpath = options.classpath(context, version);
|
||||
if (classpath) {
|
||||
args.push('-cp');
|
||||
args.push(classpath.join(Path.delimiter));
|
||||
|
||||
@@ -22,16 +22,20 @@ export function activate(context: VSCode.ExtensionContext) {
|
||||
CONNECT_TO_LS: false,
|
||||
extensionId: 'boot-java',
|
||||
launcher: (context: VSCode.ExtensionContext) => 'org.springframework.boot.loader.JarLauncher',
|
||||
classpath: (context: VSCode.ExtensionContext) => {
|
||||
classpath: (context: VSCode.ExtensionContext, javaVersion: number) => {
|
||||
const classpath = [
|
||||
Path.resolve(context.extensionPath, 'jars/language-server.jar')
|
||||
];
|
||||
const toolsJar = commons.findJvmFile('lib', 'tools.jar');
|
||||
if (toolsJar) {
|
||||
classpath.push(toolsJar);
|
||||
} else {
|
||||
VSCode.window.showWarningMessage('JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable');
|
||||
|
||||
if (javaVersion < 9) {
|
||||
const toolsJar = commons.findJvmFile('lib', 'tools.jar');
|
||||
if (toolsJar) {
|
||||
classpath.push(toolsJar);
|
||||
} else {
|
||||
VSCode.window.showWarningMessage('JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable');
|
||||
}
|
||||
}
|
||||
|
||||
return classpath;
|
||||
},
|
||||
clientOptions: {
|
||||
|
||||
Reference in New Issue
Block a user