集册 Java实例教程 获取JVM可执行文件

获取JVM可执行文件

欢马劈雪     最近更新时间:2020-01-02 10:19:05

436
获取JVM可执行文件
/* 来自 时代Java公众号 - N o w J a  v a . c o m*/

//package com.nowjava;

import java.io.File;


public class Main {

    public static void main(String[] argv) throws Exception {

        boolean w = true;

        System.out.println(getJVMExecutableFile(w));

    }


    public static final File getJVMExecutableFile(boolean w) {

        String javaHome = System.getProperty("java.home");

        File f = new File(javaHome);

        f = new File(f, "bin");

        f = 
展开阅读全文