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"?系统属性?
基础教程推荐
- JPA惰性列表上的流 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
