From 73f905960bf4bbb5c4c39c53d8cef288bea20715 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Wed, 11 Oct 2017 10:12:30 -0400 Subject: [PATCH] Fix JDK 9 server launch --- atom-extensions/atom-boot-java/lib/main.js | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/atom-extensions/atom-boot-java/lib/main.js b/atom-extensions/atom-boot-java/lib/main.js index cb5bf6fc7..1aebcd118 100644 --- a/atom-extensions/atom-boot-java/lib/main.js +++ b/atom-extensions/atom-boot-java/lib/main.js @@ -44,30 +44,28 @@ class BootJavaLanguageClient extends JarLanguageClient { launchVmArgs(version) { return super.getOrInstallLauncher().then(lsJar => { const toolsJar = this.findJavaFile('lib', 'tools.jar'); - return this.fileExists(toolsJar).then(toolsJarExists => { - if (!toolsJarExists) { - // Notify the user that tool.jar is not found - const notification = atom.notifications.addWarning(`"Boot-Java" Package Functionality Limited`, { - dismissable: true, - detail: 'No tools.jar found', - description: 'JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable', - buttons: [{ - text: 'OK', - onDidClick: () => { - notification.dismiss() - }, - }], - }); - } - return [ - // '-Xdebug', - // '-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n', - '-Dorg.slf4j.simpleLogger.logFile=boot-java.log', - '-Dorg.slf4j.simpleLogger.defaultLogLevel=debug', - '-cp', - `${toolsJarExists ? `${toolsJar}:` : ''}${lsJar}` - ]; - }); + if (!toolsJar) { + // Notify the user that tool.jar is not found + const notification = atom.notifications.addWarning(`"Boot-Java" Package Functionality Limited`, { + dismissable: true, + detail: 'No tools.jar found', + description: 'JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable', + buttons: [{ + text: 'OK', + onDidClick: () => { + notification.dismiss() + }, + }], + }); + } + return [ + '-Xdebug', + '-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n', + '-Dorg.slf4j.simpleLogger.logFile=boot-java.log', + '-Dorg.slf4j.simpleLogger.defaultLogLevel=debug', + '-cp', + `${toolsJar ? `${toolsJar}:` : ''}${lsJar}` + ]; }); }