The System.getProperty ("XXX") method is used to read the system properties in the JVM, then the system properties in the java virtual machine are configured using java -D when running the java program,
Configure in IDE
Introduction to Java.io.tmpdir
System.getproperty ("java.io.tmpdir") is a temporary directory to get the operating system cache, the cache temporary directory is different for different operating systems,
The cache directory in Windows is: C: \ Users \ Login User ~ 1 \ AppData \ Local \ Temp \
Linux:/tmp
System.getProperty (""), you can operate the parameters:
java.version |
Java runtime environment version |
java.vendor |
Java runtime environment provider |
java.vendor.url |
Java vendor URL |
java.home |
Java installation directory |
java.vm.specification.version |
Java Virtual Machine Specification Version |
java.vm.specification.vendor |
Java Virtual Machine Specification Supplier |
java.vm.specification.name |
Java Virtual Machine Specification Name |
java.vm.version |
Java virtual machine implementation version |
java.vm.vendor |
Java Virtual Machine Implementation Supplier |
java.vm.name |
Java virtual machine implementation name |
java.specification.version |
Java Runtime Environment Specification Version |
java.specification.vendor |
Java Runtime Environment Specification Supplier |
java.specification.name |
Java runtime environment specification name |
java.class.version |
Java class format version number |
java.class.path |
Java classpath |
java.library.path |
List of paths searched when loading library |
java.io.tmpdir |
Default temporary file path |
java.compiler |
The name of the JIT compiler to use |
java.ext.dirs |
Path to one or more extended directories |
os.name |
The name of the operating system |
os.arch |
Operating system architecture |
os.version |
Operating system version |
file.separator |
File separator ("/" on UNIX systems) |
path.separator |
Path separator (":" on UNIX systems) |
line.separator |
Line separator ("/ n" on UNIX systems) |
user.name |
User's account name |
user.home |
User's home directory |
user.dir |
The user's current working directory |
Such as:
System.out.println(System.getProperty("java.io.tmpdir"));
C:\Users\Kim\AppData\Local\Temp\
System.out.println(System.getProperty("java.vendor.url"));
Source: https://www.cnblogs.com/nbjin/p/7392541.html