Java JVM getJvmDll(String javahome)

Here you can find the source of getJvmDll(String javahome)

Description

get Jvm Dll

License

Open Source License

Declaration

public static String getJvmDll(String javahome) 

Method Source Code


//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import java.io.File;

public class Main {
    public static String getJvmDll(String javahome) {
        boolean isJDK = false;
        File rtJar = new File(javahome, "jre/lib/rt.jar");
        if (rtJar.exists()) {
            isJDK = new File(javahome, "lib/tools.jar").exists();
        } else {//w w  w.  j  av  a 2s.co m
            rtJar = new File(javahome, "lib/rt.jar");
        }

        File jrebase = new File(javahome);
        if (isJDK) {
            jrebase = new File(jrebase, "jre");
        }
        File jvmdll = new File(jrebase, "bin/server/jvm.dll");
        if (!jvmdll.exists()) {
            jvmdll = new File(jrebase, "bin/client/jvm.dll");
        }
        if (!jvmdll.exists()) {
            return "auto";
        } else {
            return jvmdll.getAbsolutePath();
        }
    }
}

Related

  1. getJVM()
  2. getJVMClassPath(boolean includeBootClassPath)
  3. getJvmExecutablePath()
  4. getJVMPath()
  5. isJdk()