JAVA中获取安装路径、运行路径、执行路径的办法
程序员文章站
2022-04-21 17:58:06
...
这些路径意思听起来很糊涂,对不对?这很正常,大家都这样。怎么办?开发中把下列参数进行修改,看结果是不是自己期望的那个:
/**
* <dt>java.version <dd>Java version number
* <dt>java.vendor <dd>Java vendor specific string
* <dt>java.vendor.url <dd>Java vendor URL
* <dt>java.home <dd>Java installation directory
* <dt>java.class.version <dd>Java class version number
* <dt>java.class.path <dd>Java classpath
* <dt>os.name <dd>Operating System Name
* <dt>os.arch <dd>Operating System Architecture
* <dt>os.version <dd>Operating System Version
* <dt>file.separator <dd>File separator ("/" on Unix)
* <dt>path.separator <dd>Path separator (":" on Unix)
* <dt>line.separator <dd>Line separator ("\n" on Unix)
* <dt>user.name <dd>User account name
* <dt>user.home <dd>User home directory
* <dt>user.dir <dd>User's current working directory
*/
System.out.println("java.home="+System.getProperty("java.home"));
上一篇: 有关嗅探器的文章推荐