/** * Returns the java executable for this VM or <code>null</code> if cannot be found * * @return executable for this VM or <code>null</code> if none */ File getJavaExecutable() { File installLocation = getInstallLocation(); if (installLocation != null) { return StandardVMType.findJavaExecutable(installLocation); } return null; }
/** * Returns the java executable for this VM or <code>null</code> if cannot be found * * @return executable for this VM or <code>null</code> if none */ File getJavaExecutable() { File installLocation = getInstallLocation(); if (installLocation != null) { return StandardVMType.findJavaExecutable(installLocation); } return null; }
@Override public String getJavaVersion() { StandardVMType installType = (StandardVMType) getVMInstallType(); File installLocation = getInstallLocation(); if (installLocation != null) { File executable = getJavaExecutable(); if (executable != null) { String vmVersion = installType.getVMVersion(installLocation, executable); // strip off extra info StringBuffer version = new StringBuffer(); for (int i = 0; i < vmVersion.length(); i++) { char ch = vmVersion.charAt(i); if (Character.isDigit(ch) || ch == '.') { version.append(ch); } else { break; } } if (version.length() > 0) { return version.toString(); } } } return null; }
@Override public String getJavaVersion() { StandardVMType installType = (StandardVMType) getVMInstallType(); File installLocation = getInstallLocation(); if (installLocation != null) { File executable = getJavaExecutable(); if (executable != null) { String vmVersion = installType.getVMVersion(installLocation, executable); // strip off extra info StringBuilder version = new StringBuilder(); for (int i = 0; i < vmVersion.length(); i++) { char ch = vmVersion.charAt(i); if (Character.isDigit(ch) || ch == '.') { version.append(ch); } else { break; } } if (version.length() > 0) { return version.toString(); } } LaunchingPlugin.log(NLS.bind(LaunchingMessages.vmInstall_could_not_determine_java_Version, installLocation.getAbsolutePath())); } return null; }