Java Utililty Methods JVM

List of utility methods to do JVM

Description

The list of methods to do JVM are organized into topic(s).

Method

StringgetJVM()
get JVM
String separator = System.getProperty("file.separator");
String path = System.getProperty("java.home") + separator + "bin" + separator;
if ((getOS().equals("Windows")) && (new File(path + "javaw.exe").isFile())) {
    return path + "javaw.exe";
return path + "java";
StringgetJVMClassPath(boolean includeBootClassPath)
get JVM Class Path
String jvmClassPath = System.getProperty("java.class.path");
if (includeBootClassPath) {
    String bootClassPath = System.getProperty("sun.boot.class.path");
    jvmClassPath = jvmClassPath.concat(File.pathSeparator).concat(bootClassPath);
return jvmClassPath;
StringgetJvmDll(String javahome)
get Jvm Dll
boolean isJDK = false;
File rtJar = new File(javahome, "jre/lib/rt.jar");
if (rtJar.exists()) {
    isJDK = new File(javahome, "lib/tools.jar").exists();
} else {
    rtJar = new File(javahome, "lib/rt.jar");
File jrebase = new File(javahome);
...
ObjectgetJvmExecutablePath()
Get the path of the JVM executable.
String javaHome = System.getProperty("java.home");
File jvmExe = new File(javaHome + "/bin/java");
if (jvmExe.exists()) {
    return jvmExe.getPath();
return "java";
StringgetJVMPath()
get JVM Path
return System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
booleanisJdk()
Tests if the running platform is a JDK.
return getJrePath().endsWith(File.separator + "jre");