Java基础 之 System.getProperty()方法大全

 public static void main(String[] args) {
System.out.println("java版本号:" + System.getProperty("java.version")); // java版本号
System.out.println("Java提供商名称:" + System.getProperty("java.vendor")); // Java提供商名称
System.out.println("Java提供商网站:" + System.getProperty("java.vendor.url")); // Java提供商网站
System.out.println("jre目录:" + System.getProperty("java.home")); // Java,哦,应该是jre目录
System.out.println("Java虚拟机规范版本号:" + System.getProperty("java.vm.specification.version")); // Java虚拟机规范版本号
System.out.println("Java虚拟机规范提供商:" + System.getProperty("java.vm.specification.vendor")); // Java虚拟机规范提供商
System.out.println("Java虚拟机规范名称:" + System.getProperty("java.vm.specification.name")); // Java虚拟机规范名称
System.out.println("Java虚拟机版本号:" + System.getProperty("java.vm.version")); // Java虚拟机版本号
System.out.println("Java虚拟机提供商:" + System.getProperty("java.vm.vendor")); // Java虚拟机提供商
System.out.println("Java虚拟机名称:" + System.getProperty("java.vm.name")); // Java虚拟机名称
System.out.println("Java规范版本号:" + System.getProperty("java.specification.version")); // Java规范版本号
System.out.println("Java规范提供商:" + System.getProperty("java.specification.vendor")); // Java规范提供商
System.out.println("Java规范名称:" + System.getProperty("java.specification.name")); // Java规范名称
System.out.println("Java类版本号:" + System.getProperty("java.class.version")); // Java类版本号
System.out.println("Java类路径:" + System.getProperty("java.class.path")); // Java类路径
System.out.println("Java lib路径:" + System.getProperty("java.library.path")); // Java lib路径
System.out.println("Java输入输出临时路径:" + System.getProperty("java.io.tmpdir")); // Java输入输出临时路径
System.out.println("Java编译器:" + System.getProperty("java.compiler")); // Java编译器
System.out.println("Java执行路径:" + System.getProperty("java.ext.dirs")); // Java执行路径
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("file.separator")); // 文件分隔符
System.out.println("路径分隔符:" + System.getProperty("path.separator")); // 路径分隔符
System.out.println("直线分隔符:" + System.getProperty("line.separator")); // 直线分隔符
System.out.println("操作系统用户名:" + System.getProperty("user.name")); // 用户名
System.out.println("操作系统用户的主目录:" + System.getProperty("user.home")); // 用户的主目录
System.out.println("当前程序所在目录:" + System.getProperty("user.dir")); // 当前程序所在目录
}

输出结果为:

 java版本号:1.7.0_71
Java提供商名称:Oracle Corporation
Java提供商网站:http://java.oracle.com/
jre目录:C:\Program Files\Java\jdk1.7.0_71\jre
Java虚拟机规范版本号:1.7
Java虚拟机规范提供商:Oracle Corporation
Java虚拟机规范名称:Java Virtual Machine Specification
Java虚拟机版本号:24.71-b01
Java虚拟机提供商:Oracle Corporation
Java虚拟机名称:Java HotSpot(TM) 64-Bit Server VM
Java规范版本号:1.7
Java规范提供商:Oracle Corporation
Java规范名称:Java Platform API Specification
Java类版本号:51.0
Java类路径:D:\mywork\cocopay\manager\target\classes;D:\mywork\cocopay\commons\target\classes;D:\soft\localRepository\org\apache\logging\log4j\log4j-core\2.0.1\log4j-core-2.0.1.jar;D:\soft\localRepository\org\apache\logging\log4j\log4j-1.2-api\2.0.1\log4j-1.2-api-2.0.1.jar;D:\soft\localRepository\org\apache\logging\log4j\log4j-slf4j-impl\2.0.1\log4j-slf4j-impl-2.0.1.jar;D:\mywork\cocopay\security\target\classes;D:\soft\localRepository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\mywork\cocopay\mm-api\target\classes;D:\soft\localRepository\org\jibx\jibx-bind\1.2.5\jibx-bind-1.2.5.jar;D:\soft\localRepository\bcel\bcel\5.1\bcel-5.1.jar;D:\soft\localRepository\regexp\regexp\1.2\regexp-1.2.jar;D:\soft\localRepository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\soft\localRepository\com\thoughtworks\qdox\qdox\1.12.1\qdox-1.12.1.jar;D:\soft\localRepository\org\jibx\jibx-tools\1.2.5\jibx-tools-1.2.5.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.core.contenttype\3.4.100.v20110423-0524\org.eclipse.core.contenttype-3.4.100.v20110423-0524.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.core.jobs\3.5.100.v20110404\org.eclipse.core.jobs-3.5.100.v20110404.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.core.resources\3.7.100.v20110510-0712\org.eclipse.core.resources-3.7.100.v20110510-0712.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.core.runtime\3.7.0.v20110110\org.eclipse.core.runtime-3.7.0.v20110110.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.equinox.common\3.6.0.v20110523\org.eclipse.equinox.common-3.6.0.v20110523.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.equinox.preferences\3.4.0.v20110502\org.eclipse.equinox.preferences-3.4.0.v20110502.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.jdt.core\3.7.0.v_B61\org.eclipse.jdt.core-3.7.0.v_B61.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.osgi\3.7.0.v20110613\org.eclipse.osgi-3.7.0.v20110613.jar;D:\soft\localRepository\org\jibx\config\3rdparty\org\eclipse\org.eclipse.text\3.5.100.v20110505-0800\org.eclipse.text-3.5.100.v20110505-0800.jar;D:\soft\localRepository\org\jibx\jibx-schema\1.2.5\jibx-schema-1.2.5.jar;D:\soft\localRepository\org\jibx\jibx-extras\1.2.5\jibx-extras-1.2.5.jar;D:\soft\localRepository\org\jdom\jdom\1.1.3\jdom-1.1.3.jar;D:\soft\localRepository\javax\servlet\jsp\jsp-api\2.1\jsp-api-2.1.jar;D:\soft\localRepository\org\springframework\spring-context\4.1.1.RELEASE\spring-context-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-aop\4.1.1.RELEASE\spring-aop-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-beans\4.1.1.RELEASE\spring-beans-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-core\4.1.1.RELEASE\spring-core-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-expression\4.1.1.RELEASE\spring-expression-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-web\4.1.1.RELEASE\spring-web-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-webmvc\4.1.1.RELEASE\spring-webmvc-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-test\4.1.1.RELEASE\spring-test-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-context-support\4.1.1.RELEASE\spring-context-support-4.1.1.RELEASE.jar;D:\soft\localRepository\org\springframework\security\spring-security-core\3.2.4.RELEASE\spring-security-core-3.2.4.RELEASE.jar;D:\soft\localRepository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\soft\localRepository\org\springframework\security\spring-security-config\3.2.4.RELEASE\spring-security-config-3.2.4.RELEASE.jar;D:\soft\localRepository\org\springframework\security\spring-security-web\3.2.4.RELEASE\spring-security-web-3.2.4.RELEASE.jar;D:\soft\localRepository\org\springframework\security\spring-security-taglibs\3.2.4.RELEASE\spring-security-taglibs-3.2.4.RELEASE.jar;D:\soft\localRepository\org\springframework\security\spring-security-acl\3.2.4.RELEASE\spring-security-acl-3.2.4.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-jdbc\4.1.1.RELEASE\spring-jdbc-4.1.1.RELEASE.jar;D:\soft\localRepository\org\aspectj\aspectjweaver\1.8.1\aspectjweaver-1.8.1.jar;D:\soft\localRepository\org\apache\logging\log4j\log4j-api\2.0.1\log4j-api-2.0.1.jar;D:\soft\localRepository\jstl\jstl\1.2\jstl-1.2.jar;D:\soft\localRepository\taglibs\standard\1.1.2\standard-1.1.2.jar;D:\soft\localRepository\org\mybatis\mybatis-spring\1.2.2\mybatis-spring-1.2.2.jar;D:\soft\localRepository\org\mybatis\mybatis\3.2.8\mybatis-3.2.8.jar;D:\soft\localRepository\org\apache\commons\commons-dbcp2\2.0.1\commons-dbcp2-2.0.1.jar;D:\soft\localRepository\org\apache\commons\commons-pool2\2.2\commons-pool2-2.2.jar;D:\soft\localRepository\mysql\mysql-connector-java\5.1.33\mysql-connector-java-5.1.33.jar;D:\soft\localRepository\commons-io\commons-io\2.0\commons-io-2.0.jar;D:\soft\localRepository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\soft\localRepository\commons-fileupload\commons-fileupload\1.2.1\commons-fileupload-1.2.1.jar;D:\soft\localRepository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;D:\soft\localRepository\org\apache\tomcat\servlet-api\6.0.39\servlet-api-6.0.39.jar;D:\soft\localRepository\velocity\velocity\1.5\velocity-1.5.jar;D:\soft\localRepository\oro\oro\2.0.8\oro-2.0.8.jar;D:\soft\localRepository\org\apache\tiles\tiles-core\2.2.2\tiles-core-2.2.2.jar;D:\soft\localRepository\org\apache\tiles\tiles-api\2.2.2\tiles-api-2.2.2.jar;D:\soft\localRepository\commons-digester\commons-digester\2.0\commons-digester-2.0.jar;D:\soft\localRepository\commons-beanutils\commons-beanutils\1.8.0\commons-beanutils-1.8.0.jar;D:\soft\localRepository\org\apache\tiles\tiles-jsp\2.2.2\tiles-jsp-2.2.2.jar;D:\soft\localRepository\org\apache\tiles\tiles-servlet\2.2.2\tiles-servlet-2.2.2.jar;D:\soft\localRepository\org\apache\tiles\tiles-template\2.2.2\tiles-template-2.2.2.jar;D:\soft\localRepository\dom4j\dom4j\1.6\dom4j-1.6.jar;D:\soft\localRepository\net\sf\opencsv\opencsv\2.3\opencsv-2.3.jar;D:\soft\localRepository\org\apache\poi\poi\3.9\poi-3.9.jar;D:\soft\localRepository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;D:\soft\localRepository\org\apache\poi\poi-ooxml\3.9\poi-ooxml-3.9.jar;D:\soft\localRepository\org\apache\poi\poi-ooxml-schemas\3.9\poi-ooxml-schemas-3.9.jar;D:\soft\localRepository\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar;D:\soft\localRepository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\soft\localRepository\org\quartz-scheduler\quartz\2.2.1\quartz-2.2.1.jar;D:\soft\localRepository\c3p0\c3p0\0.9.1.1\c3p0-0.9.1.1.jar;D:\soft\localRepository\org\slf4j\slf4j-api\1.6.6\slf4j-api-1.6.6.jar;D:\soft\localRepository\org\quartz-scheduler\quartz-jobs\2.2.1\quartz-jobs-2.2.1.jar;D:\soft\localRepository\com\alibaba\fastjson\1.1.41\fastjson-1.1.41.jar;D:\soft\localRepository\net\sf\ehcache\ehcache\2.7.0\ehcache-2.7.0.jar;D:\soft\localRepository\net\sf\ehcache\ehcache-core\2.6.5\ehcache-core-2.6.5.jar;D:\soft\localRepository\org\springframework\security\spring-security-cas-client\3.0.8.RELEASE\spring-security-cas-client-3.0.8.RELEASE.jar;D:\soft\localRepository\org\springframework\spring-tx\4.1.1.RELEASE\spring-tx-4.1.1.RELEASE.jar;D:\soft\localRepository\org\jasig\cas\cas-client-core\3.1.10\cas-client-core-3.1.10.jar;D:\soft\localRepository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;D:\soft\localRepository\org\apache\commons\commons-compress\1.3\commons-compress-1.3.jar;D:\soft\localRepository\org\jibx\jibx-run\1.2.5\jibx-run-1.2.5.jar;D:\soft\localRepository\joda-time\joda-time\2.1\joda-time-2.1.jar;D:\soft\localRepository\xpp3\xpp3\1.1.3.4.O\xpp3-1.1.3.4.O.jar;D:\soft\localRepository\com\jcraft\jsch\0.1.51\jsch-0.1.51.jar;D:\soft\localRepository\org\apache\httpcomponents\httpclient\4.3.5\httpclient-4.3.5.jar;D:\soft\localRepository\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;D:\soft\localRepository\org\imgscalr\imgscalr-lib\4.2\imgscalr-lib-4.2.jar
Java lib路径:C:\Program Files\Java\jdk1.7.0_71\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\soft\appcan\AppCanStudioPersonalV3.1\HDK\emulator\mas\;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\apache-tomcat-7.0.55\bin;D:\apache-tomcat-7.0.55\lib;D:\Program Files\apache-maven-3.2.2\bin;E:\soft\spring-roo-1.3.1.RC1\bin;;.
Java输入输出临时路径:C:\Users\ADMINI~1\AppData\Local\Temp\
Java编译器:null
Java执行路径:C:\Program Files\Java\jdk1.7.0_71\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
操作系统名称:Windows 7
操作系统的架构:amd64
操作系统版本号:6.1
文件分隔符:\
路径分隔符:;
直线分隔符: 操作系统用户名:Administrator
操作系统用户的主目录:C:\Users\Administrator
当前程序所在目录:D:\mywork\cocopay\manager

Java基础 之 System.getProperty()方法的更多相关文章

  1. 获取当前应用的系统路径工具类和java的System.getProperty()方法介绍

    java的System.getProperty()方法可以获取的值,如下: 对于Java程序,无论是未打包的还是打包的JAR或WAR文件,有时候都需要获取它运行所在目录信息,如何做到这一点呢? /** ...

  2. Java System.getProperty()方法获取系统信息

    用 System.getProperty()方法能获取到的系统信息: java.version Java 运行时环境版本 java.vendor Java 运行时环境供应商 java.vendor.u ...

  3. 【java编程】使用System.getProperty方法,如何配置JVM系统属性

    转载:https://www.cnblogs.com/acm-bingzi/p/6673823.html很多时候我们需要在项目中读取外部属性文件,用到了System.getProperty(" ...

  4. 使用System.getProperty方法,如何配置JVM系统属性

    原创文章,欢迎转载,转载请注明出处! 很多时候我们需要在项目中读取外部属性文件,用到了System.getProperty("")方法.这个方法需要配置JVM系统属性,那么如何配置 ...

  5. 使用System.getProperty方法,如何配置JVM系统属性 (转载)

    很多时候需要在项目中读取外部属性文件,用到了System.getProperty("")方法.这个方法需要配置JVM系统属性,那么如何配置呢? 那就是使用java -D 配置系统属 ...

  6. JAVA基础语法:函数(方法)、类和对象(转载)

    4.JAVA基础语法:函数(方法).类和对象 函数 在java中函数也称为方法,是一段具备某种功能的可重用代码块. 一个函数包括这几部分: 函数头 函数头包括函数访问修饰符,函数返回值类型, 函数名, ...

  7. System.getProperty()方法大全

    System.out.println("当前程序所在目录:" + System.getProperty("user.dir")); // 当前程序所在目录 Sy ...

  8. System.getProperty()方法获取大全

    System.out.println("java版本号:" + System.getProperty("java.version")); // java版本号 ...

  9. System.getProperty()方法大全 (转载)

    System.out.println("java版本号:" + System.getProperty("java.version")); // java版本号S ...

随机推荐

  1. Linux - SVN的基本操作

    SVN的基本操作 本文地址: http://blog.csdn.net/caroline_wendy $ svn diff //显示改动 $ post-review --summary="b ...

  2. github入门基础之上传本地文件以及安装github客户端

    github 不会使用,参照了其他大神的博客看的,很不错,就按步骤来,大家可以看看 http://www.cnblogs.com/wangzhongqiu/p/6243840.html

  3. iphone怎么检测屏幕是否被点亮 (用UIApplication的Delegate)

    本文转载至  http://gaohaijun.blog.163.com/blog/static/176698271201161524857373/     问题:那位能说一下怎么能检测到iphone ...

  4. windows10系统自带输入法不能切换中文如何解决

    具体如下: 1.打开计算机管理软件,右击“开始”按钮,在弹出的菜单中选择“计算机管理”: 2.或在桌面右击“此电脑”图标,在弹出的菜单中选择“管理”: 3.在打开的计算机管理软件中,选择“系统工具”- ...

  5. Aeroplane chess(简单概率dp)

    Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz start ...

  6. 第一课 第一个nodejs程序

    这就是我们的第一个程序了 在控制台会输出:hello 我们需要运行该文件 开始->运行 cmd 进入我们的程序目录 我的是D:/nodejs/hello.js 进入程序目录cd D:/nodej ...

  7. 【Emit】关于System.MethodAccessException解决方案

        最近学习Emit,在使用Emit动态生成对象时碰到一些"蛋疼"的问题,如下: 1.安全透明方法"XXX.XX()"尝试访问安全关键方法"YYY ...

  8. Python菜鸟之路:Python基础-逼格提升利器:装饰器Decorator

    一.装饰器 装饰器是一个很著名的设计模式,经常被用于有切面需求的场景,较为经典的有插入日志.性能测试.事务处理等. 装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量函数中与函数功能本身 ...

  9. 4.对urls.py的解释

    解释: 路由配置文件(URL分发器),它的本质是URL模式以及要为该URL模式调用的视图函数之间的映射表.就是以这种方式告诉Django对于每个URL的处理类.Django启动的时候回去加载urls. ...

  10. mysql怎么在已建好的表中添加自增序列

     alter table 表明 change id id int not null auto_increment unique;