在 Windows 7 上,Java JVM 如何设置“user.home"?系统属性? [英] On Windows 7, how does Java JVM set "user.home" System property?

查看:18
本文介绍了在 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设置者:

  1. 读取注册表项的值:HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersDesktop
  2. 取该值的父路径,但解析环境变量.
  1. Read the registry value for key: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersDesktop
  2. 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"?系统属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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