获取java JRE的路径 [英] Get path to java JRE

查看:327
本文介绍了获取java JRE的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以获取用于当前进程的jre的位置。需要启动其他java应用程序作为单独的进程。有不同的jre可用(并且没有路径变量设置)我想问,例如。这个装载机。在Solaris,Linux,Windows上运行。

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 available (and no path variable set) I would like ask eg. the loader for this. Running on Solaris, Linux, Windows.

推荐答案

您可以使用:

System.getProperty("java.home")

http://download.oracle .com / javase / 6 / docs / api / java / lang / System.html #getProperties%28%29 说:


java.home:Java安装目录

java.home: Java installation directory

这篇关于获取java JRE的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆