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/







  • 相关阅读:
    Git常用命令
    更新CentOS内核
    VMware虚拟机安装Ubuntu系统步骤详解
    Ubuntu安装遇到的问题
    IOT OS and OTA
    gcc c asm,C程序内嵌汇编
    makefile and make tips
    RTEMS目录梳理Sparc
    关于FreeRTOS的信号量、队列
    FreeRTOS任务源码分析以及程序堆栈与任务堆栈的关系
  • 原文地址:https://www.cnblogs.com/itniwota/p/14168267.html
Copyright © 2011-2022 走看看