On Windows 7, how does Java JVM set quot;user.homequot; System property?(在 Windows 7 上,Java JVM 如何设置“user.home?系统属性?)
问题描述
我使用的是 JRE 1.7,我发现 user.home 系统属性非常不寻常.JVM是如何设置这个值的?
I am using JRE 1.7 and I discovered the user.home System property is very unusual. How does the JVM set this value?
推荐答案
这个 Java 错误解释了如何:http://bugs.sun.com/view_bug.do?bug_id=4787931
This Java bug explains how: http://bugs.sun.com/view_bug.do?bug_id=4787931
系统属性user.home设置者:
- 读取注册表项的值:
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersDesktop - 取该值的父路径,但不解析环境变量.
- Read the registry value for key:
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersDesktop - Take the parent path of this value, but do not resolve environment variables.
示例:%userprofile%Desktop => %userprofile%(未解析的环境变量)
Example: %userprofile%Desktop => %userprofile% (unresolved environment variable)
这个问题应该在 Java 8 中得到修复.
This issue should be fixed in Java 8.
相关参考:Java 用户.home 被设置为 %userprofile% 并且没有被解析
这篇关于在 Windows 7 上,Java JVM 如何设置“user.home"?系统属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Windows 7 上,Java JVM 如何设置“user.home"?系统属性?
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
