开发者

get current jre's file path

开发者 https://www.devze.com 2023-03-30 03:44 出处:网络
Suppose we have two java applications A and B. Application A will call application B. Application A has started, however when A calls B, I don\'t know the jav开发者_如何学Goa_home or any other jre pat

Suppose we have two java applications A and B. Application A will call application B. Application A has started, however when A calls B, I don't know the jav开发者_如何学Goa_home or any other jre path, I want to get which jre application A is run on, return the jre's execution file's path, is this possible?


You can get the installation directory for the JRE by requesting the system propertie java.home:

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

More on System Properties here.

0

精彩评论

暂无评论...
验证码 换一张
取 消