Get path to java JRE

前端 未结 3 687
半阙折子戏
半阙折子戏 2020-12-06 04:40

It it possible to get the location of the jre that is used for the current process. Need to launch an other java application as a separate process. Having different jre\'s a

3条回答
  •  暖寄归人
    2020-12-06 04:50

    System.out.println(System.getProperty("java.home"));

    The code above will return the full physical path to current jvm's jre path. Tested only in Windows 10.

提交回复
热议问题