Skip to content

Commit

Permalink
Revert "Fix eclipse-jdtls#43 support starting the JLS with Java 9"
Browse files Browse the repository at this point in the history
This reverts commit 58d2a3e.
  • Loading branch information
fbricon committed Oct 11, 2016
1 parent b6b2ca8 commit 8f71e33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* enhancement - configure extra VM arguments in VS Code settings, used to launch the Java Language Server. See [#25](https://github.com/redhat-developer/vscode-java/issues/25).
* enhancement - configure java.home property in VS Code settings. See [#28](https://github.com/redhat-developer/vscode-java/issues/28).
* enhancement - improve Javadoc formatting on hover (scrollbar). See [#31](https://github.com/redhat-developer/vscode-java/issues/31).
* enhancement - support running the Java Language Server with Java 9. See [#43](https://github.com/redhat-developer/vscode-java/issues/43).
* enhancement - add feedback when starting the Java Language Server. See [#49](https://github.com/redhat-developer/vscode-java/issues/49).
* enhancement - add hover for package fragments. See [JLS#84](https://github.com/gorkem/java-language-server/pull/84).
* bug fix - fix Java Language Server downloading when using a Proxy (take 2). See [#42](https://github.com/redhat-developer/vscode-java/issues/42).
Expand Down
5 changes: 1 addition & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function runJavaServer(){
params.push('-Dlog.protocol=true');
params.push('-Dlog.level=ALL');
}

params.push('-jar'); params.push(path.resolve( __dirname ,'../../server/plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar'));
//select configuration directory according to OS
let configDir = 'config_win';
Expand All @@ -55,9 +55,6 @@ function runJavaServer(){
}
params.push('-configuration'); params.push(path.resolve( __dirname ,'../../server',configDir));
params.push('-data'); params.push(workspacePath);
if (requirements.java_version > 8) {
params.push('--add-modules=java.se.ee');
}

let vmargs = workspace.getConfiguration("java").get("jdt.ls.vmargs","");
parseVMargs(params, vmargs);
Expand Down
15 changes: 6 additions & 9 deletions src/requirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const findJavaHome = require('find-java-home');

interface RequirementsData {
java_home: string
java_version: number
}

interface ErrorData {
Expand All @@ -30,9 +29,9 @@ interface ErrorData {
*/
export async function resolveRequirements(): Promise<RequirementsData> {
let java_home = await checkJavaRuntime();
let javaVersion = await checkJavaVersion(java_home);
let isJava8 = await checkJavaVersion(java_home);
let serverInstalled = await checkServerInstalled();
return Promise.resolve({ "java_home": java_home, "java_version":javaVersion});
return Promise.resolve({ "java_home": java_home });
}

async function checkJavaRuntime(): Promise<any> {
Expand Down Expand Up @@ -79,12 +78,10 @@ async function checkJavaRuntime(): Promise<any> {
async function checkJavaVersion(java_home: string): Promise<any> {
return new Promise((resolve, reject) => {
let result = cp.execFile(java_home + '/bin/java', ['-version'], {}, (error, stdout, stderr) => {
if (stderr.indexOf('1.8') < 0 && stderr.indexOf('9.') < 0) {
openJDKDownload(reject, "Java 8 minimum is required to run. Please download and install the latest JDK.");
} else {
let version = (stderr.indexOf('1.8') >= 0)?8:9;
resolve(version);
}
if (stderr.indexOf('1.8') < 0)
openJDKDownload(reject, "Java 8 is required to run. Please download and install a JDK 8.");
else
resolve(true);
});
});
}
Expand Down

0 comments on commit 8f71e33

Please sign in to comment.