/** * Return <code>true</code> if the appropriate system libraries can be found for the * specified java executable, <code>false</code> otherwise. * @param javaHome the Java home folder * @param javaExecutable the Java executable file * @return <code>true</code> if the default system libraries can be detected for the given install location * <code>false</code> otherwise */ protected boolean canDetectDefaultSystemLibraries(File javaHome, File javaExecutable) { LibraryLocation[] locations = getDefaultLibraryLocations(javaHome); String version = getVMVersion(javaHome, javaExecutable); return locations.length > 0 && !version.startsWith("1.1"); //$NON-NLS-1$ }
/** * Return <code>true</code> if the appropriate system libraries can be found for the * specified java executable, <code>false</code> otherwise. * @param javaHome the Java home folder * @param javaExecutable the Java executable file * @return <code>true</code> if the default system libraries can be detected for the given install location * <code>false</code> otherwise */ protected boolean canDetectDefaultSystemLibraries(File javaHome, File javaExecutable) { LibraryLocation[] locations = getDefaultLibraryLocations(javaHome); String version = getVMVersion(javaHome, javaExecutable); return locations.length > 0 && !version.startsWith("1.1"); //$NON-NLS-1$ }
@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; }