public class SystemPropertyTest {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("==================");
System.out.println("JAVA相关");
System.out.println("==================");
System.out.println("JAVA安装目录:" + System.getProperty("java.home"));
System.out.println("JAVA类格式版本:"
+ System.getProperty("java.class.version"));
System.out.println("JAVA类路径:" + System.getProperty("java.class.path"));
System.out.println("JAVA加载库时搜索的路径列表:"
+ System.getProperty("java.library.path"));
System.out.println("JAVA默认的临时文件路径:"
+ System.getProperty("java.io.tmpdir"));
System.out.println("JAVA要使用的JIT编译器的名称:"
+ System.getProperty("java.compiler"));
System.out.println("JAVA一个或多个扩展目录的路径:"
+ System.getProperty("java.ext.dirs"));
System.out.println(System.getProperty("line.separator"));
System.out.println("==================");
System.out.println("JAVA run time 相关");
System.out.println("==================");
System.out.println("JAVA运行时环境版本:" + System.getProperty("java.version"));
System.out.println("JAVA运行时环境供应商:" + System.getProperty("java.vendor"));
System.out.println("JAVA运行时环境供应商URL:"
+ System.getProperty("java.vendor.url"));
System.out.println("JAVA运行时环境规范版本:"
+ System.getProperty("java.specification.version"));
System.out.println("JAVA运行时环境规范供应商:"
+ System.getProperty("java.specification.vendor"));
System.out.println("JAVA运行时环境规范名称:"
+ System.getProperty("java.specification.name"));
System.out.println(System.getProperty("line.separator"));
System.out.println("==================");
System.out.println("JVM相关");
System.out.println("==================");
System.out.println("JAVA虚拟机规范版本:"
+ System.getProperty("java.vm.specification.version"));
System.out.println("JAVA虚拟机规范供应商:"
+ System.getProperty("java.vm.specification.vendor"));
System.out.println("JAVA虚拟机规范名称:"
+ System.getProperty("java.vm.specification.name"));
System.out.println("JAVA虚拟机实现版本:"
+ System.getProperty("java.vm.version"));
System.out.println("JAVA虚拟机实现供应商:"
+ System.getProperty("java.vm.vendor"));
System.out.println("JAVA虚拟机实现名称:" + System.getProperty("java.vm.name"));
System.out.println(System.getProperty("line.separator"));
System.out.println("==================");
System.out.println("操作系统相关");
System.out.println("==================");
System.out.println("操作系统名称:" + System.getProperty("os.name"));
System.out.println("操作系统架构:" + System.getProperty("os.arch"));
System.out.println("操作系统版本:" + System.getProperty("os.version"));
System.out.println(System.getProperty("line.separator"));
System.out.println("文件分隔符:" + System.getProperty("file.separator"));
System.out.println("路径分隔符:这里开始" + System.getProperty("path.separator")
+ "这里结束");
System.out.println("行分隔符:这里开始" + System.getProperty("line.separator")
+ "这里结束");
System.out.println(System.getProperty("line.separator"));
System.out.println("==================");
System.out.println("当前用户相关");
System.out.println("==================");
System.out.println("当前用户的账户名称:" + System.getProperty("user.name"));
System.out.println("当前用户的主目录:" + System.getProperty("user.home"));
System.out.println("当前用户的当前工作目录:" + System.getProperty("user.dir"));
}
}
System.getProperty可用的参数
最新推荐文章于 2023-05-08 09:46:14 发布