get JVM Executable File - Java File Path IO

Java examples for File Path IO:File Operation

Description

get JVM Executable File

Demo Code


//package com.java2s;
import java.io.File;

public class Main {
    public static void main(String[] argv) throws Exception {
        boolean w = true;
        System.out.println(getJVMExecutableFile(w));
    }/* w ww .  ja  v  a 2  s  . c o  m*/

    public static final File getJVMExecutableFile(boolean w) {
        String javaHome = System.getProperty("java.home");
        File f = new File(javaHome);
        f = new File(f, "bin");
        f = new File(f, w ? "javaw.exe" : "java.exe");
        return f;
    }
}

Related Tutorials