List of utility methods to do JDK Home Get
String | getJdkBin() get Jdk Bin File bin = new File(getJdkHome() + File.separator + "bin"); if (!bin.exists()) { throw new IOException("Unable to locate JDK bin: '" + bin + "'"); return bin.getAbsolutePath(); |
String | getJdkHome() get Jdk Home String javaHome = System.getProperty("java.home"); if (!javaHome.endsWith(File.separator + "jre")) { throw new IOException("Unable to locate executable JDK Home."); return javaHome.substring(0, javaHome.length() - 4); |
File | getJdkHome() Return a lazy guess at the JDK home based on the JAVA_HOME. List<String> candidates = new ArrayList<String>(); candidates.add(System.getProperty(GRADLE_VIEW_JAVA_HOME_KEY)); candidates.add(System.getenv("JAVA_HOME")); for (String candidate : candidates) { if (candidate != null) { File jdkHome = new File(candidate); if (jdkHome.exists()) { return jdkHome; ... |
String | getJDKHomeVariable() get JDK Home Variable String jdkHome = System.getProperty("jdk.home"); if (jdkHome == null || "".equals(jdkHome)) { jdkHome = getJDKHomeFromEclipseVm(); if (jdkHome == null || "".equals(jdkHome)) { jdkHome = System.getenv("JDK_HOME"); return jdkHome; ... |
String | getJDKPath(File file) get JDK Path if (file == null) { return null; if ("bin".equals(file.getName())) { return file.getParent(); } else { return getJDKPath(file.getParentFile()); |