Java JVM getJVM()

Here you can find the source of getJVM()

Description

get JVM

License

Open Source License

Declaration

public static String getJVM() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    private static String OS;

    public static String getJVM() {
        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";
        }/*ww w .  java 2 s. c  o m*/

        return path + "java";
    }

    public static String getOS() {
        if ((OS == null) || (OS == ""))
            OS = "UNKNOW";
        return OS;
    }
}

Related

  1. getJVMClassPath(boolean includeBootClassPath)
  2. getJvmDll(String javahome)
  3. getJvmExecutablePath()
  4. getJVMPath()