Java gets the server environment, java gets the server
Package com. rapido. utils; import java. util. properties;/*** get server environment information * @ author X-rapido **/public class SystemDataUtil {public static Properties getSystemProperties () {Properties props = System. getProperties (); // System property return props;} public static void main (String [] args) {Properties props = getSystemProperties (); System. out. println ("Java Runtime Environment version:" + props. getProperty ("java. version "); System. out. println ("Java Runtime Environment vendor:" + props. getProperty ("java. vendor "); System. out. println ("Java vendor URL:" + props. getProperty ("java. vendor. url "); System. out. println ("Java installation path:" + props. getProperty ("java. home "); System. out. println ("Java Virtual Machine Specification Version:" + props. getProperty ("java. vm. specification. version "); System. out. println ("Java virtual machine specification Supplier:" + props. getProperty ("java. vm. specification. vendor "); System. out. println ("Java virtual machine specification name:" + props. getProperty ("java. vm. specification. name "); System. out. println ("Java Virtual Machine implementation version:" + props. getProperty ("java. vm. version "); System. out. println ("Java Virtual Machine implementation vendor:" + props. getProperty ("java. vm. vendor "); System. out. println ("Java Virtual Machine implementation name:" + props. getProperty ("java. vm. name "); System. out. println ("Java Runtime Environment Standard Version:" + props. getProperty ("java. specification. version "); System. out. println ("Java Runtime Environment specification Supplier:" + 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:" + props. getProperty ("java. class. version "); System. out. println ("Java class path:" + props. getProperty ("java. class. path "); System. out. println ("List of paths searched during Database loading:" + props. getProperty ("java. library. path "); System. out. println ("Default temporary file path:" + props. getProperty ("java. io. tmpdir "); System. out. println ("path of one or more extended directories:" + props. getProperty ("java. ext. dirs "); System. out. println ("operating system name:" + props. getProperty ("OS. name "); System. out. println ("Operating System Architecture:" + props. getProperty ("OS. arch "); System. out. println ("OS version:" + props. getProperty ("OS. version "); System. out. println ("file separator:" + props. getProperty ("file. separator "); // in unix System, it is"/"System. out. println ("path separator:" + props. getProperty ("path. separator "); //": "System. out. println ("line separator:" + props. getProperty ("line. separator "); //"/n "System in unix. out. println ("User Account name:" + props. getProperty ("user. name "); System. out. println ("Your home directory:" + props. getProperty ("user. home "); System. out. println ("current working directory of the User:" + props. getProperty ("user. dir "));}}Below is my local configuration output
Java Runtime Environment version: 1.7.0 _ 45Java runtime environment vendor: URL of Oracle configurationjava vendor: http://java.oracle.com/javainstallation :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 Supplier: Oracle configurationjava Virtual Machine specification name: Java Virtual Machine SpecificationJava Virtual Machine implementation version: 24.45-b08Java Virtual Machine implementation Supplier: virtual Machine implementation name of Oracle configurationjava: Java HotSpot (TM) 64-Bit Server VMJava runtime environment Specification Version: 1. 7Java runtime environment specification Supplier: nullJava runtime environment specification name: Java Platform API SpecificationJava class format version: 51.0Java class path: D: \ workSpaces \ mavenprojects \ 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 \ mavenprojects \ 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.ja R: The Path list searched when loading the Library: 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 \ System32 \ Wbem; C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \; E: \ Program Files (x86) \ QuickTime \ QTSystem \; E: \ Program Files \ Java \ jdk1.7.0 _ 51 \ lib; E: \ Prog Ram Files \ Java \ jdk1.7.0 _ 51 \ jar \ bin;. Default temporary file path: C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \ path of one or more extension 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: Windows 7 Operating System Architecture: amd64 operating system version: 6.1 file separator: \ path separator:; line separator: User 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