Package Com.itm.path;public class testsystemproperty{public static void Main (string[] args) {System.out.println ("Ja VA runtime Environment version: \ n "+system.getproperty (" java.version ")); System.out.println ("Java Runtime Environment vendor: \ n" +system.getproperty ("Java.vendor")); System.out.println ("Url:\n of Java Vendor" +system.getproperty ("Java.vendor.url")); System.out.println ("Java installation directory: \ n" +system.getproperty ("Java.home")); System.out.println ("Java Virtual machine specification version: \ n" +system.getproperty ("java.vm.specification.version")); System.out.println ("Java class format version number: \ n" +system.getproperty ("java.class.version")); System.out.println ("Java classpath: \ n" +system.getproperty ("Java.class.path")); SYSTEM.OUT.PRINTLN ("List of paths searched when loading library: \ n" +system.getproperty ("Java.library.path")); SYSTEM.OUT.PRINTLN ("Default temporary file path: \ n" +system.getproperty ("Java.io.tmpdir")); System.out.println ("Name of the JIT compiler to use: \ n" +system.getproperty ("Java.compiler")); SYSTEM.OUT.PRINTLN ("Path to one or more extended directories: \ n" +system.getproperty ("Java.ext.dirs")); System.out.println ("Name of the operating system: \ n"+system.getproperty (" Os.name ")); SYSTEM.OUT.PRINTLN ("Architecture of the operating system: \ n" +system.getproperty ("Os.arch")); SYSTEM.OUT.PRINTLN ("OS version: \ n" +system.getproperty ("os.version")); System.out.println ("File delimiter (in UNIX system is"/"): \ n" +system.getproperty ("File.separator")); SYSTEM.OUT.PRINTLN ("Path delimiter (in UNIX system is": "): \ n" +system.getproperty ("Path.separator")); SYSTEM.OUT.PRINTLN ("The line delimiter (in UNIX system is"/n "): \ n" +system.getproperty ("Line.separator")); System.out.println ("User's account name: \ n" +system.getproperty ("User.Name")); System.out.println ("User's home directory: \ n" +system.getproperty ("User.home")); System.out.println ("User's current working directory: \ n" +system.getproperty ("User.dir")); System.out.println ("uri notation for the absolute path of the current classpath:---->>: \ n" + thread.currentthread (). Getcontextclassloader (). GetResource ("")); System.out.println ("Gets the URI directory of the current class Filetest.class file. Don't include yourself! : \ n "+testsystemproperty.class.getresource (")); System.out.println ("Gets the absolute URI path of the current classpath. : \ n "+ TestSystemproperty.class.getResource ("/")); }}
Java to get Java information through code, such as virtual machine, version, PATH, etc.