System中可以获取到的property等数据

简介: System中可以获取到的property等数据
public class Test {
    public static void main(String[] args) {
        String javaVersion = System.getProperty("java.version");//Java运行环境版本
        String javaVendor = System.getProperty("java.vendor");//Java运行时环境供应商
        String javaVendorUrl = System.getProperty("java.vendor.url");//Java供应商URL
        String javaHome = System.getProperty("java.home");//Java安装目录
        String javaVmSpecificationVersion = System.getProperty("java.vm.specification.version");//Java虚拟机规范版本
        String javaVmSpecificationVendor = System.getProperty("java.vm.specification.vendor");//Java虚拟机规范供应商
        String javaVmSpecificationName = System.getProperty("java.vm.specification.name");//Java虚拟机规范名称
        String javaVmVersion = System.getProperty("java.vm.version");//Java虚拟机实现版本
        String javaVmVendor = System.getProperty("java.vm.vendor");//Java虚拟机实现供应商
        String javaVmName = System.getProperty("java.vm.name");//Java虚拟机实现名称
        String javaSpecificationVersion = System.getProperty("java.specification.version");//Java运行时环境规范版本
        String javaSpecificationVendor = System.getProperty("java.specification.vendor");//Java运行时环境规范供应商
        String javaSpecificationName = System.getProperty("java.specification.name");//Java运行时环境规范名称
        String javaClassVersion = System.getProperty("java.class.version");//Java类格式版本号
        String javaClassPath = System.getProperty("java.class.path");//Java类路径
        String javaLibraryPath = System.getProperty("java.library.path");//加载库时搜索的路径列表
        String javaIoTmpdir = System.getProperty("java.io.tmpdir");//默认的临时文件路径
        String javaCompiler = System.getProperty("java.compiler");//要使用的JIT编译器的名称
        String javaExtDirs = System.getProperty("java.ext.dirs");//一个或多个扩展目录的路径
        String osName = System.getProperty("os.name");//操作系统名称
        String osArch = System.getProperty("os.arch");//操作系统的架构
        String osVersion = System.getProperty("os.version");//操作系统版本
        String fileSeparator = System.getProperty("file.separator");//文件分隔符(在UNIX系统中是“/”)
        String pathSeparator = System.getProperty("path.separator");//路径分隔符(在UNIX系统中是“:”)
        String lineSeparator = System.getProperty("line.separator");//行分隔符(在UNIX系统中是“/n”)
        String userName = System.getProperty("user.name");//用户的账户名称
        String userHome = System.getProperty("user.home");//用户的主目录
        String userDir = System.getProperty("user.dir");//行分隔符(在UNIX系统中是“/n”)
        System.out.println("javaVersion:::::"+javaVersion);
        System.out.println("javaVendor:::::"+javaVendor);
        System.out.println("javaVendorUrl:::::"+javaVendorUrl);
        System.out.println("javaHome:::::"+javaHome);
        System.out.println("javaVmSpecificationVersion:::::"+javaVmSpecificationVersion);
        System.out.println("javaVmSpecificationVendor:::::"+javaVmSpecificationVendor);
        System.out.println("javaVmSpecificationName:::::"+javaVmSpecificationName);
        System.out.println("javaVmVersion:::::"+javaVmVersion);
        System.out.println("javaVmVendor:::::"+javaVmVendor);
        System.out.println("javaVmName:::::"+javaVmName);
        System.out.println("javaSpecificationVersion:::::"+javaSpecificationVersion);
        System.out.println("javaSpecificationVendor:::::"+javaSpecificationVendor);
        System.out.println("javaSpecificationName:::::"+javaSpecificationName);
        System.out.println("javaClassVersion:::::"+javaClassVersion);
        System.out.println("javaClassPath:::::"+javaClassPath);
        System.out.println("javaLibraryPath:::::"+javaLibraryPath);
        System.out.println("javaIoTmpdir:::::"+javaIoTmpdir);
        System.out.println("javaCompiler:::::"+javaCompiler);
        System.out.println("javaExtDirs:::::"+javaExtDirs);
        System.out.println("osName:::::"+osName);
        System.out.println("osArch:::::"+osArch);
        System.out.println("osVersion:::::"+osVersion);
        System.out.println("fileSeparator:::::"+fileSeparator);
        System.out.println("pathSeparator:::::"+pathSeparator);
        System.out.println("lineSeparator:::::"+lineSeparator);
        System.out.println("userName:::::"+userName);
        System.out.println("userHome:::::"+userHome);
        System.out.println("userDir:::::"+userDir);
    }
}
目录
相关文章
|
7月前
|
数据库 数据库管理
System.ArgumentException:“The specified invariant name ‘System.Data.SQLite‘ wasn‘t found in the list
System.ArgumentException:“The specified invariant name ‘System.Data.SQLite‘ wasn‘t found in the list
58 0
|
2月前
|
存储 Python
property-data.
【10月更文挑战第14天】
27 1
|
6月前
|
存储 监控 安全
System.getProperty()方法总结
System.getProperty()方法总结
|
7月前
|
API Android开发 开发者
failed to set system property error code: 0x18
failed to set system property error code: 0x18
347 1
|
7月前
|
Java
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
179 1
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
|
NoSQL Java Redis
一日一技:在什么情况下使用@property比较好?
一日一技:在什么情况下使用@property比较好?
92 0
|
消息中间件 Kafka
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of
这个问题是gradle的build版本问题,我是在build kafka的老版本时报的错,这个问题我查了一遍网上的内容,发现很多博客忽略了IDEA settings关于gradle的build的一个配置。
522 0
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of
|
Java
PropertyReferenceException: No property getAll found for type Users!
Java Spring Boot 2.0连接 MongoDB 4.0时候出错。 抛出来一堆异常信息,最后找到问题根源,解决办法:
3754 0