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

查看:612
本文介绍了在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 的设置方式为:

System property user.home is set by:


  1. 阅读密钥的注册表值: HKEY_CURRENT_USER \Software\Microsoft\Windows\CurrentVersion\Explorer \ Shell文件夹\Desktop

  2. 获取此值的父路径,但解析环境变量。

  1. Read the registry value for key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop
  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 user.home被设置为%u serprofile%并且没有得到解决

这篇关于在Windows 7上,Java JVM如何设置“user.home”。系统属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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