@Override public IStatus validateInstallLocation(File javaHome) { IStatus status = null; File javaExecutable = findJavaExecutable(javaHome); if (javaExecutable == null) { status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1, null); // } else { if (canDetectDefaultSystemLibraries(javaHome, javaExecutable)) { status = new Status(IStatus.OK, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_ok_2, null); } else { status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_root__System_library_was_not_found__1, null); } } return status; }
@Override public void disposeVMInstall(String id) { IVMInstall vm = findVMInstall(id); if (vm != null) { String path = vm.getInstallLocation().getAbsolutePath(); LaunchingPlugin.setLibraryInfo(path, null); fgFailedInstallPath.remove(path); fgDefaultLibLocs.remove(path); } super.disposeVMInstall(id); }
/** * Returns default library information for the given install location. * * @param installLocation the VM install location * @return LibraryInfo */ protected LibraryInfo getDefaultLibraryInfo(File installLocation) { IPath rtjar = getDefaultSystemLibrary(installLocation); File extDir = getDefaultExtensionDirectory(installLocation); File endDir = getDefaultEndorsedDirectory(installLocation); String[] dirs = null; if (extDir == null) { dirs = new String[0]; } else { dirs = new String[] {extDir.getAbsolutePath()}; } String[] endDirs = null; if (endDir == null) { endDirs = new String[0]; } else { endDirs = new String[] {endDir.getAbsolutePath()}; } return new LibraryInfo("???", new String[] {rtjar.toOSString()}, dirs, endDirs); //$NON-NLS-1$ }
@Override public URL getDefaultJavadocLocation(File installLocation) { File javaExecutable = findJavaExecutable(installLocation); if (javaExecutable != null) { LibraryInfo libInfo = getLibraryInfo(installLocation, javaExecutable); if (libInfo != null) { String version = libInfo.getVersion(); return getDefaultJavadocLocation(version); } } return null; }
File javaExecutable = findJavaExecutable(installLocation); LibraryInfo libInfo; if (javaExecutable == null) { libInfo = getDefaultLibraryInfo(installLocation); } else { libInfo = getLibraryInfo(installLocation, javaExecutable); allLibs = new ArrayList<LibraryLocation>(gatherAllLibraries(libInfo.getEndorsedDirs())); URL url = getDefaultJavadocLocation(installLocation); for (int i = 0; i < bootpath.length; i++) { IPath path = new Path(bootpath[i]); if (lib.exists() && lib.isFile()) { LibraryLocation libraryLocation = new LibraryLocation(path, getDefaultSystemLibrarySource(lib), getDefaultPackageRootPath(), url); boot.add(libraryLocation); allLibs.addAll(gatherAllLibraries(libInfo.getExtensionDirs()));
info = fgFailedInstallPath.get(installPath); if (info == null) { String version = readReleaseVersion(javaHome); if (JavaCore.compareJavaVersions(version, JavaCore.VERSION_1_8) > 0) { info = new LibraryInfo(version, new String[0], new String[0], new String[0]); LaunchingPlugin.setLibraryInfo(installPath, info); } else { info = generateLibraryInfo(javaHome, javaExecutable); if (info == null) { info = generateLibraryInfo(javaHome, javaExecutable); info = getDefaultLibraryInfo(javaHome); fgFailedInstallPath.put(installPath, info); } else {
File parentsrc= new File(parent, SRC_JAR); if (parentsrc.isFile()) { setDefaultRootPath(SRC); return new Path(parentsrc.getPath()); setDefaultRootPath(""); //$NON-NLS-1$ return new Path(parentsrc.getPath()); IPath result = checkForJ9LibrarySource(libLocation); if (result != null) { return result; setDefaultRootPath(""); //$NON-NLS-1$ return Path.EMPTY;
/** * Return library information corresponding to the specified install * location. If the information does not exist, create it using the given Java * executable. * @param javaHome the Java home folder * @param javaExecutable the Java executable file * @return the {@link LibraryInfo} for the home and executable path or an empty object, never <code>null</code> */ protected synchronized LibraryInfo getLibraryInfo(File javaHome, File javaExecutable) { String installPath = javaHome.getAbsolutePath(); LibraryInfo info = LaunchingPlugin.getLibraryInfo(installPath); if (info == null || LaunchingPlugin.timeStampChanged(installPath)) { info = fgFailedInstallPath.get(installPath); if (info == null) { info = generateLibraryInfo(javaHome, javaExecutable); if (info == null) { info = getDefaultLibraryInfo(javaHome); fgFailedInstallPath.put(installPath, info); } else { // only persist if we were able to generate information - see bug 70011 LaunchingPlugin.setLibraryInfo(installPath, info); } } } return info; }
/** * 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; }
return StandardVMType.getDefaultJavadocLocation(version);
if (dirs != null) { allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs))); allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs))); allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs)));
File javaExecutable = findJavaExecutable(installLocation); LibraryInfo libInfo; if (javaExecutable == null) { libInfo = getDefaultLibraryInfo(installLocation); } else { libInfo = getLibraryInfo(installLocation, javaExecutable); allLibs = new ArrayList<>(gatherAllLibraries(libInfo.getEndorsedDirs())); URL url = getDefaultJavadocLocation(installLocation); if (libInfo.getBootpath().length == 0) { File lib = path.toFile(); if (lib.exists() && lib.isFile()) { sourceRootPath = getDefaultSystemLibrarySource(lib); // To attach source if available } else { path = new Path(installLocation.getAbsolutePath()).append(SRC_ZIP); lib = path.toFile(); if (lib.exists() && lib.isFile()) { sourceRootPath = getDefaultSystemLibrarySource(lib); // To attach source if available sourceRootPath, getDefaultPackageRootPath(), getDefaultJavadocLocation(installLocation)); allLibs.add(libraryLocation); if (lib.exists() && lib.isFile()) { LibraryLocation libraryLocation = new LibraryLocation(path, getDefaultSystemLibrarySource(lib), getDefaultPackageRootPath(), url);
@Override public URL getDefaultJavadocLocation(File installLocation) { File javaExecutable = findJavaExecutable(installLocation); if (javaExecutable != null) { LibraryInfo libInfo = getLibraryInfo(installLocation, javaExecutable); if (libInfo != null) { String version = libInfo.getVersion(); return getDefaultJavadocLocation(version); } } return null; }
File parentsrc= new File(parent, SRC_JAR); if (parentsrc.isFile()) { setDefaultRootPath(SRC); return new Path(parentsrc.getPath()); setDefaultRootPath(""); //$NON-NLS-1$ return new Path(parentsrc.getPath()); IPath result = checkForJ9LibrarySource(libLocation); if (result != null) { return result; setDefaultRootPath(""); //$NON-NLS-1$ return Path.EMPTY;
/** * 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; }
return StandardVMType.getDefaultJavadocLocation(version);
if (dirs != null) { allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs))); allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs))); allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs)));
/** * Returns default library information for the given install location. * * @param installLocation the VM install location * @return LibraryInfo */ protected LibraryInfo getDefaultLibraryInfo(File installLocation) { IPath rtjar = getDefaultSystemLibrary(installLocation); File extDir = getDefaultExtensionDirectory(installLocation); File endDir = getDefaultEndorsedDirectory(installLocation); String[] dirs = null; if (extDir == null) { dirs = new String[0]; } else { dirs = new String[] {extDir.getAbsolutePath()}; } String[] endDirs = null; if (endDir == null) { endDirs = new String[0]; } else { endDirs = new String[] {endDir.getAbsolutePath()}; } return new LibraryInfo("???", new String[] {rtjar.toOSString()}, dirs, endDirs); //$NON-NLS-1$ }
@Override public IStatus validateInstallLocation(File javaHome) { IStatus status = null; File javaExecutable = findJavaExecutable(javaHome); if (javaExecutable == null) { status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1, null); // } else { if (canDetectDefaultSystemLibraries(javaHome, javaExecutable)) { status = new Status(IStatus.OK, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_ok_2, null); } else { status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_root__System_library_was_not_found__1, null); } } return status; }
exe = ((StandardVM)fVMInstance).getJavaExecutable(); } else { exe = StandardVMType.findJavaExecutable(fVMInstance.getInstallLocation());