zoukankan      html  css  js  c++  java
  • System.getProperty()和getenv()

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

    System.getProperties() 获取所有系统属性

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

    系统属性说明:

    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"));
    }    
    System.out.println(System.getenv("Java_Home"));
  • 相关阅读:
    国内的pythoner强烈建议使用豆瓣的pypi源 zz
    python3.x中的urllib模块
    idcheck.py
    17、关于hibernate的N+1问题
    16、【转】Hibernate 原汁原味的四种抓取策略
    1、SSH的整合---->将Struts2整合到Spring中
    1、利用json2html.js处理json数据
    1、Ubuntu14.04使用root登陆帐户
    2、CentOS中修改yum源
    1、在CentOS上安装Java JDK的步骤
  • 原文地址:https://www.cnblogs.com/ConciseAaron/p/4104546.html
Copyright © 2011-2022 走看看