java中如何获得操作系统下用户目录

阅读更多

String usrHome = System.getProperty("user.home");

下面是System的参数列表

Key                     Meaning
-------------------     ------------------------------
"file.separator"        File separator (e.g., "/")
"java.class.path"       Java classpath
"java.class.version"    Java class version number
"java.home"             Java installation directory
"java.vendor"           Java vendor-specific string

"java.vendor.url"       Java vendor URL
"java.version"          Java version number
"line.separator"        Line separator
"os.arch"               Operating system architecture
"os.name"               Operating system name

"path.separator"        Path separator (e.g., ":")
"user.dir"              User's current working directory
"user.home"             User home directory
"user.name"             User account name

 

 

spring xml配置使用EL表达试例子:

 

#{T(java.lang.System).getProperty('user.home')}

你可能感兴趣的:(java,spring,el)