zoukankan      html  css  js  c++  java
  • Java 常用系统变量

    String userHome = System.getProperty("user.home");  //用户主目录
    String userDir = System.getProperty("user.dir"); //用户当前工作目录
    String userName = System.getProperty("user.name"); //当前用户名称
    String lineSeparator = System.getProperty("line.separator");//系统换行符
    String pathSeparator = System.getProperty("path.separator"); //
    String fileSeparator= System.getProperty("file.separator");//路径分割符号
    String osVersion = System.getProperty("os.version"); //当前系统版本
    String osArch = System.getProperty("os.arch"); //系统架构
    String osName = System.getProperty("os.name"); //系统名称
    String javaIoTmpdir = System.getProperty("java.io.tmpdir"); //系统临时文件目录


    System.out.println("userHome:"+userHome);
    System.out.println("userDir:"+userDir);
    System.out.println("userName:"+userName);
    System.out.println("lineSeparator:"+lineSeparator);
    System.out.println("pathSeparator:"+pathSeparator);
    System.out.println("fileSeparator:"+fileSeparator);
    System.out.println("osVersion:"+osVersion);
    System.out.println("osArch:"+osArch);
    System.out.println("os.name:"+osName);
    System.out.println("javaIoTmpdir:"+javaIoTmpdir);


    userHome:/Users/gg
    userDir:/Users/gg/Downloads/java-spring-oidc-example
    userName:gg
    lineSeparator:

    pathSeparator::
    fileSeparator:/
    osVersion:10.16
    osArch:x86_64
    os.name:Mac OS X
    javaIoTmpdir:/var/folders/76/dx6jknd54q7fwtlqkcr1vrz00000gn/T/







  • 相关阅读:
    SCOI2020游记
    关于我
    WC2020游记
    CSP-S 2019 游记
    回文自动机学习笔记
    全自动数字论证机(迫真)
    树状数组上二分
    《伊豆的舞女》 读书小记
    雅礼集训2019 Day5
    雅礼集训2019 Day4
  • 原文地址:https://www.cnblogs.com/itniwota/p/14168267.html
Copyright © 2011-2022 走看看