modules/orionode/languages/jdt/index.js
function getJavaHome() {
	if(!java_home) {
		if(typeof process.env.JAVA_HOME === 'string' && process.env.JAVA_HOME) {
			java_home = process.env.JAVA_HOME;
		} else if(process.platform === 'darwin') {
			java_home = cp.execSync("/usr/libexec/java_home").toString().trim();
		} else if(process.platform === 'linux') {
			//TODO anything magical we can do here to compute the 'default' Java?
		} else if(process.platform === 'win32') {
			//TODO not sure Windows has any way to know where Java is installed
		}
	}
	return java_home;
}
function getJavaHome() {
	if(!java_home) {
		if(typeof process.env.JAVA_HOME === 'string' && process.env.JAVA_HOME) {
			java_home = process.env.JAVA_HOME;
		} else if(process.platform === 'darwin') {
			java_home = cp.execSync("/usr/libexec/java_home").toString().trim();
		} else if(process.platform === 'linux') {
			//TODO anything magical we can do here to compute the 'default' Java?
		} else if(process.platform === 'win32') {
			//TODO not sure Windows has any way to know where Java is installed
		}
	}
	return java_home;
}
function getJavaHome ( ) { if ( ! java_home ) { if ( typeof process . env . JAVA_HOME === 'string' && process . env . JAVA_HOME ) { java_home = process . env . JAVA_HOME ; } else if ( process . platform === 'darwin' ) { java_home = cp . execSync ( "/usr/libexec/java_home" ) . toString ( ) . trim ( ) ; } else if ( process . platform === 'linux' ) { //TODO anything magical we can do here to compute the 'default' Java? } else if ( process . platform === 'win32' ) { //TODO not sure Windows has any way to know where Java is installed } } return java_home ; }
Gets the Java home location from the backing process environment, or tries to compute it.
@returns {string} The Java home location or `null`
@since 18.0
Gets the Java home location from the backing process environment or tries to compute it .