gpt4 book ai didi

windows - 在 Windows 中找到正在运行的 JRE 目录

转载 作者:可可西里 更新时间:2023-11-01 14:51:43 25 4
gpt4 key购买 nike

知道 java 版本(例如 1.6.0_31)后,我如何以编程方式(从 Java 程序中)找到相应 JRE 在 Windows 机器磁盘上的位置?

最佳答案

应该可以通过读取java.home系统环境变量的值得到。参见 http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html .

但请记住,安全管理员可能会阻止您访问以上链接:

Security consideration: Access to system properties can be restricted by the Security Manager. This is most often an issue in applets, which are prevented from reading some system properties, and from writing any system properties. For more on accessing system properties in applets, refer to System Properties in the Doing More With Java Rich Internet Applications lesson.

关于windows - 在 Windows 中找到正在运行的 JRE 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12281779/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com