modules/orionode/languages/jdt/index.js
function runJavaServer(javaHome, options) {
	return new Promise(function(resolve, reject) {
		const child = path.join(javaHome, '/jre/bin/java'),
			params = [];
		if (DEBUG) {
			params.push('-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044');
		}
		params.push("-Dlog.level=ALL");
		params.push('-Declipse.application=org.eclipse.jdt.ls.core.id1');
		params.push('-Dosgi.bundles.defaultStartLevel=4');
		params.push('-Declipse.product=org.eclipse.jdt.ls.core.product');
		if (DEBUG) {
			params.push('-Dlog.protocol=true');
		}
		var pluginsFolder = path.resolve(__dirname, './plugins');
		return fs.readdirAsync(pluginsFolder).then(function(files) {
			if (Array.isArray(files) && files.length !== 0) {
				for (var i = 0, length = files.length; i < length; i++) {
					var file = files[i];
					var indexOf = file.indexOf('org.eclipse.equinox.launcher_');
					if (indexOf !== -1) {
						params.push('-jar');
						params.push(path.resolve(__dirname, './plugins/' + file));
			
						//select configuration directory according to OS
						var configDir = 'config_win';
						if (process.platform === 'darwin') {
							configDir = 'config_mac';
						} else if (process.platform === 'linux') {
							configDir = 'config_linux';
						}
						params.push('-configuration');
						params.push(path.resolve(__dirname, configDir));
						params.push('-data');
						params.push(options.workspaceDir);
					}
				}
				return fork(child, params, options).then((childProcess) => {
					resolve(childProcess);
				}, (err) => {
					reject(err);
				});
			}
		});
	});
}
function runJavaServer(javaHome, options) {
	return new Promise(function(resolve, reject) {
		const child = path.join(javaHome, '/jre/bin/java'),
			params = [];
		if (DEBUG) {
			params.push('-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044');
		}
		params.push("-Dlog.level=ALL");
		params.push('-Declipse.application=org.eclipse.jdt.ls.core.id1');
		params.push('-Dosgi.bundles.defaultStartLevel=4');
		params.push('-Declipse.product=org.eclipse.jdt.ls.core.product');
		if (DEBUG) {
			params.push('-Dlog.protocol=true');
		}
		var pluginsFolder = path.resolve(__dirname, './plugins');
		return fs.readdirAsync(pluginsFolder).then(function(files) {
			if (Array.isArray(files) && files.length !== 0) {
				for (var i = 0, length = files.length; i < length; i++) {
					var file = files[i];
					var indexOf = file.indexOf('org.eclipse.equinox.launcher_');
					if (indexOf !== -1) {
						params.push('-jar');
						params.push(path.resolve(__dirname, './plugins/' + file));
			
						//select configuration directory according to OS
						var configDir = 'config_win';
						if (process.platform === 'darwin') {
							configDir = 'config_mac';
						} else if (process.platform === 'linux') {
							configDir = 'config_linux';
						}
						params.push('-configuration');
						params.push(path.resolve(__dirname, configDir));
						params.push('-data');
						params.push(options.workspaceDir);
					}
				}
				return fork(child, params, options).then((childProcess) => {
					resolve(childProcess);
				}, (err) => {
					reject(err);
				});
			}
		});
	});
}
function runJavaServer ( javaHome , options ) { return new Promise ( function ( resolve , reject ) { const child = path . join ( javaHome , '/jre/bin/java' ) , params = [ ] ; if ( DEBUG ) { params . push ( '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044' ) ; } params . push ( "-Dlog.level=ALL" ) ; params . push ( '-Declipse.application=org.eclipse.jdt.ls.core.id1' ) ; params . push ( '-Dosgi.bundles.defaultStartLevel=4' ) ; params . push ( '-Declipse.product=org.eclipse.jdt.ls.core.product' ) ; if ( DEBUG ) { params . push ( '-Dlog.protocol=true' ) ; } var pluginsFolder = path . resolve ( __dirname , './plugins' ) ; return fs . readdirAsync ( pluginsFolder ) . then ( function ( files ) { if ( Array . isArray ( files ) && files . length !== 0 ) { for ( var i = 0 , length = files . length ; i < length ; i ++ ) { var file = files [ i ] ; var indexOf = file . indexOf ( 'org.eclipse.equinox.launcher_' ) ; if ( indexOf !== - 1 ) { params . push ( '-jar' ) ; params . push ( path . resolve ( __dirname , './plugins/' + file ) ) ; //select configuration directory according to OS var configDir = 'config_win' ; if ( process . platform === 'darwin' ) { configDir = 'config_mac' ; } else if ( process . platform === 'linux' ) { configDir = 'config_linux' ; } params . push ( '-configuration' ) ; params . push ( path . resolve ( __dirname , configDir ) ) ; params . push ( '-data' ) ; params . push ( options . workspaceDir ) ; } } return fork ( child , params , options ) . then ( ( childProcess ) => { resolve ( childProcess ) ; } , ( err ) => { reject ( err ) ; } ) ; } } ) ; } ) ; }
Run the Java language server
@param {string} javaHome The absolute path to the Java home directory
@param {{?}} options The map of options
@returns {Promise} A promise to load the Java language server
Run the Java language server