码迷,mamicode.com
首页 > 编程语言 > 详细

java中的System.getProperty()和getenv()方法

时间:2014-11-17 22:42:03      阅读:354      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   os   sp   java   

Java system.getproperty(String name)获取系统属性

属性说明:

bubuko.com,布布扣

public class test{
    public static void main(String[] args) {
        System.out.println("Java Runtime Environment version = "
                + System.getProperty("java.version"));
        System.out.println("Java Runtime Environment vendor = "
                + System.getProperty("java.vendor"));
        System.out.println("Java vendor URL = "
                + System.getProperty("java.vendor.url"));
        System.out.println("Java installation directory = "
                + System.getProperty("java.home"));
        System.out.println("Java Virtual Machine specification version = "
                + System.getProperty("java.vm.specification.version"));
        System.out.println("Java Runtime Environment specification  version = "
                + System.getProperty("java.specification.version"));
        System.out.println("Java class format version number = "
                + System.getProperty("java.class.version"));
        System.out.println("Java class path = "
                + System.getProperty("java.class.path"));
        System.out.println("Operating system name = "
                + System.getProperty("os.name"));
        System.out.println("Operating system architecture = "
                + System.getProperty("os.arch"));
        System.out.println("File separator (‘/‘ on UNIX) = "
                + System.getProperty("file.separator"));
        System.out.println("User‘s account name = "
                + System.getProperty("user.name"));
        System.out.println("User‘s home directory = "
                + System.getProperty("user.home"));
        System.out.println("User‘s current working directory = "
                + System.getProperty("user.dir"));
}    

Java system.getenv(String name)获取环境变量

System.out.println(System.getenv("Java_Home"));

 

java中的System.getProperty()和getenv()方法

标签:style   blog   http   io   color   ar   os   sp   java   

原文地址:http://www.cnblogs.com/ConciseAaron/p/4104546.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!