Package Com.rapido.utils;import java.util.properties;/** * Get Server environment information * @author X-rapido * */public class Systemdatautil {p Ublic static Properties Getsystemproperties () {Properties props = system.getproperties ();//System Properties return props;} public static void Main (string[] args) {Properties props = getsystemproperties (); SYSTEM.OUT.PRINTLN ("Running environment version of Java:" + props.getproperty ("java.version")); SYSTEM.OUT.PRINTLN ("Running environment provider for Java:" + props.getproperty ("Java.vendor")); System.out.println ("Java Vendor URL:" + props.getproperty ("Java.vendor.url")); SYSTEM.OUT.PRINTLN ("Installation path for Java:" + props.getproperty ("Java.home")); System.out.println ("Java version of the virtual machine specification:" + props.getproperty ("java.vm.specification.version")); SYSTEM.OUT.PRINTLN ("Java specification Provider for virtual machines:" + props.getproperty ("Java.vm.specification.vendor")); SYSTEM.OUT.PRINTLN ("Java Virtual machine Specification Name:" + props.getproperty ("Java.vm.specification.name")); SYSTEM.OUT.PRINTLN ("Virtual machine implementation version of Java:" + props.getproperty ("java.vm.version")); SYSTEM.OUT.PRINTLN ("Java Virtual machine Implementation provider:" + Props.getproperty ("JAVA.VM.Vendor ")); SYSTEM.OUT.PRINTLN ("Java Virtual machine Implementation name:" + props.getproperty ("Java.vm.name")); System.out.println ("Java Runtime Environment Specification version:" + Props.getproperty ("java.specification.version")); System.out.println ("Java Runtime Environment Specification provider:" + props.getproperty ("Java.specification.vender")); System.out.println ("Java Runtime Environment Specification name:" + props.getproperty ("Java.specification.name")); System.out.println ("Java Class format version number:" + props.getproperty ("java.class.version")); System.out.println ("Java classpath:" + props.getproperty ("Java.class.path")); SYSTEM.OUT.PRINTLN ("List of paths searched when loading library:" + props.getproperty ("Java.library.path")); SYSTEM.OUT.PRINTLN ("Default temporary file path:" + props.getproperty ("Java.io.tmpdir")); SYSTEM.OUT.PRINTLN ("Path to one or more extended directories:" + props.getproperty ("Java.ext.dirs")); System.out.println ("Name of the operating system:" + props.getproperty ("Os.name")); SYSTEM.OUT.PRINTLN ("Architecture of the Operating system:" + props.getproperty ("Os.arch")); SYSTEM.OUT.PRINTLN ("OS version:" + Props.getproperty ("os.version")); System.out.println ("File delimiter:" + props.getproperty ("File.separator")); In Unix system is "/" System.out.println("Path delimiter:" + props.getproperty ("Path.separator")); In Unix system is ":" System.out.println ("line delimiter:" + props.getproperty ("Line.separator")); In the UNIX system is "/n" System.out.println ("User's account name:" + props.getproperty ("User.Name")); System.out.println ("User's home directory:" + props.getproperty ("User.home")); System.out.println ("User's current working directory:" + props.getproperty ("User.dir"));}}
Here is my native configuration output
Java Runtime version: 1.7.0_45java's operating Environment vendor: Url:http://java.oracle.com/java installation path for Oracle Corporationjava vendor: E:\Program Files \myeclipse for Spring 2014\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\ Jrejava Virtual Machine Specification version: 1.7Java Virtual machine Specification Vendor: Virtual machine Specification name for Oracle Corporationjava: Java virtual machines Specificationjava Virtual Machine Implementation version: 24.45-b08java Virtual machine Implementation Vendor: Virtual machine Implementation name for Oracle Corporationjava: Java HotSpot (TM) 64-bit Server Vmjava Runtime Environment Specification version: 1.7Java Runtime Environment Specification Vendor: Nulljava Runtime Environment Specification name: Java Platform API Specificationjava class format version number: 51.0Java class path: D:\ Workspaces\mavenproject\create_direct_pay_by_user-java-utf-8\build\classes;d:\workspaces\mavenproject\create_ Direct_pay_by_user-java-utf-8\webroot\web-inf\lib\commons-codec-1.6.jar;d:\workspaces\mavenproject\create_ Direct_pay_by_user-java-utf-8\webroot\web-inf\lib\commons-httpclient-3.0.1.jar;d:\workspaces\mavenproject\ Create_direct_pay_by_user-java-utf-8\webroot\web-inf\lib\commons-logging-1.1.1.jar;d:\workspaces\mavenproject\ Create_direct_pay_by_user-java-utf-8\webroot\web-inf\lib\dom4j-1.6.1.jar;d:\workspaces\mavenproject\create_direct_pay_by_user-java-utf-8\webroot\web-inf\lib\jaxen-1.1-beta-6.jar;d:\ workspaces\mavenproject\create_direct_pay_by_user-java-utf-8\webroot\web-inf\lib\servlet-api.jar list of paths searched when loading libraries: E : \program Files\myeclipse for Spring 2014\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\bin; C:\Windows\Sun\Java\bin; C:\Windows\system32; C:\Windows; E:\app\Administrator\product\11.2.0\dbhome_1\bin; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; E:\Program Files (x86) \quicktime\qtsystem\; E:\Program Files\java\jdk1.7.0_51\lib; E:\Program files\java\jdk1.7.0_51\jar\bin;;. Default temporary file path: c:\users\admini~1\appdata\local\temp path to one or more extended directories: E:\Program files\myeclipse for Spring 2014\binary\ Com.sun.java.jdk7.win32.x86_64_1.7.0.u45\jre\lib\ext; C:\Windows\Sun\Java\lib\ext Operating system Name: Architecture of the Windows 7 operating system: AMD64 OS Version: 6.1 File delimiter: path delimiter:; Line delimiter: User's account name: Administrator user's home directory: C:\Users\Administrator user's current working directory: D:\workSpaces\MavenProject\create_direct_pay_ By_user-jAva-utf-8
Java Get Server environment