get current jre's file path

坚强是说给别人听的谎言 提交于 2019-12-10 19:26:52

问题


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 java_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?


回答1:


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.



来源:https://stackoverflow.com/questions/7176603/get-current-jres-file-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!