Set<String> sets=System.getProperties().stringPropertyNames(); for (String key : sets) { System.out.println(key+" : "+System.getProperty(key)); }
output:
java.runtime.name : Java(TM) SE Runtime Environment sun.boot.library.path : C:\Program Files\Java\jdk1.8.0_231\jre\bin java.vm.version : 25.231-b11 java.vm.vendor : Oracle Corporation java.vendor.url : http://java.oracle.com/ path.separator : ; java.vm.name : Java HotSpot(TM) 64-Bit Server VM file.encoding.pkg : sun.io user.script : user.country : US sun.java.launcher : SUN_STANDARD sun.os.patch.level : java.vm.specification.name : Java Virtual Machine Specification user.dir : D:\mavenproject\cabrite\cabrite-meshviewer java.runtime.version : 1.8.0_231-b11 java.awt.graphicsenv : sun.awt.Win32GraphicsEnvironment java.endorsed.dirs : C:\Program Files\Java\jdk1.8.0_231\jre\lib\endorsed os.arch : amd64 java.io.tmpdir : C:\Users\19030421\AppData\Local\Templine.separator : java.vm.specification.vendor : Oracle Corporation user.variant : os.name : Windows 10 org.uncommons.reportng.xml-dialect : testng sun.jnu.encoding : Cp1252 java.library.path : C:\Program Files\Java\jdk1.8.0_231\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Python39\Scripts\;C:\Python39\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_231\bin;C:\Program Files\nodejs\;D:\Programs\apache-maven-3.6.3\bin;C:\Program Files\Java\jdk1.8.0_231\jre\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\NetSarang\Xshell 7\;C:\Program Files (x86)\NetSarang\Xftp 7\;C:\Users\19030421\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\bin;;C:\Users\19030421\AppData\Roaming\npm;D:\Programs\Microsoft VS Code\bin;. java.specification.name : Java Platform API Specification java.class.version : 52.0 sun.management.compiler : HotSpot 64-Bit Tiered Compilers os.version : 10.0 user.home : C:\Users\19030421 user.timezone : Asia/Shanghai java.awt.printerjob : sun.awt.windows.WPrinterJob java.specification.version : 1.8 file.encoding : UTF-8 user.name : 19030421 java.class.path : D:\Programs\ideaIC-2020.3.2.win\lib\idea_rt.jar;D:\Programs\ideaIC-2020.3.2.win\plugins\testng\lib\testng-rt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\rt.jar;D:\mavenproject\cabrite\cabrite-meshviewer\target\test-classes;D:\mavenproject\cabrite\cabrite-meshviewer\target\classes;D:\mavenproject\cabrite\cabrite-core\target\classes;D:\mavenrepository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;D:\mavenrepository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;D:\mavenrepository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;D:\mavenrepository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;D:\mavenrepository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;D:\mavenrepository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;D:\mavenrepository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;D:\mavenrepository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;D:\mavenrepository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;D:\mavenrepository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;D:\mavenrepository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;D:\mavenrepository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;D:\mavenrepository\org\seleniumhq\selenium\htmlunit-driver\2.33.2\htmlunit-driver-2.33.2.jar;D:\mavenrepository\net\sourceforge\htmlunit\htmlunit\2.33\htmlunit-2.33.jar;D:\mavenrepository\xalan\xalan\2.7.2\xalan-2.7.2.jar;D:\mavenrepository\xalan\serializer\2.7.2\serializer-2.7.2.jar;D:\mavenrepository\org\apache\commons\commons-lang3\3.8\commons-lang3-3.8.jar;D:\mavenrepository\org\apache\commons\commons-text\1.4\commons-text-1.4.jar;D:\mavenrepository\org\apache\httpcomponents\httpmime\4.5.6\httpmime-4.5.6.jar;D:\mavenrepository\org\apache\httpcomponents\httpclient\4.5.6\httpclient-4.5.6.jar;D:\mavenrepository\org\apache\httpcomponents\httpcore\4.4.10\httpcore-4.4.10.jar;D:\mavenrepository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;D:\mavenrepository\net\sourceforge\htmlunit\htmlunit-core-js\2.33\htmlunit-core-js-2.33.jar;D:\mavenrepository\net\sourceforge\htmlunit\neko-htmlunit\2.33\neko-htmlunit-2.33.jar;D:\mavenrepository\xerces\xercesImpl\2.12.0\xercesImpl-2.12.0.jar;D:\mavenrepository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;D:\mavenrepository\net\sourceforge\htmlunit\htmlunit-cssparser\1.2.0\htmlunit-cssparser-1.2.0.jar;D:\mavenrepository\commons-io\commons-io\2.6\commons-io-2.6.jar;D:\mavenrepository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\mavenrepository\commons-net\commons-net\3.6\commons-net-3.6.jar;D:\mavenrepository\org\eclipse\jetty\websocket\websocket-client\9.4.12.v20180830\websocket-client-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\jetty-client\9.4.12.v20180830\jetty-client-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\jetty-http\9.4.12.v20180830\jetty-http-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\jetty-xml\9.4.12.v20180830\jetty-xml-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\jetty-util\9.4.12.v20180830\jetty-util-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\jetty-io\9.4.12.v20180830\jetty-io-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\websocket\websocket-common\9.4.12.v20180830\websocket-common-9.4.12.v20180830.jar;D:\mavenrepository\org\eclipse\jetty\websocket\websocket-api\9.4.12.v20180830\websocket-api-9.4.12.v20180830.jar;D:\mavenrepository\com\google\inject\guice\4.2.3\guice-4.2.3.jar;D:\mavenrepository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\mavenrepository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\mavenrepository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\mavenrepository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\mavenrepository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\mavenrepository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;D:\mavenrepository\org\json\json\20201115\json-20201115.jar;D:\mavenrepository\org\testng\testng\6.8\testng-6.8.jar;D:\mavenrepository\junit\junit\4.10\junit-4.10.jar;D:\mavenrepository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar;D:\mavenrepository\org\beanshell\bsh\2.0b4\bsh-2.0b4.jar;D:\mavenrepository\com\beust\jcommander\1.27\jcommander-1.27.jar;D:\mavenrepository\org\yaml\snakeyaml\1.6\snakeyaml-1.6.jar;D:\mavenrepository\org\uncommons\reportng\1.1.4\reportng-1.1.4.jar;D:\mavenrepository\velocity\velocity\1.4\velocity-1.4.jar;D:\mavenrepository\velocity\velocity-dep\1.4\velocity-dep-1.4.jar;D:\Programs\ideaIC-2020.3.2.win\lib\idea_rt.jar java.vm.specification.version : 1.8 sun.arch.data.model : 64 java.home : C:\Program Files\Java\jdk1.8.0_231\jre sun.java.command : com.intellij.rt.testng.RemoteTestNGStarter -usedefaultlisteners false -socket55369 @w@C:\Users\19030421\AppData\Local\Temp\idea_working_dirs_testng.tmp -temp C:\Users\19030421\AppData\Local\Temp\idea_testng.tmp java.specification.vendor : Oracle Corporation user.language : en awt.toolkit : sun.awt.windows.WToolkit java.vm.info : mixed mode java.version : 1.8.0_231 java.ext.dirs : C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext sun.boot.class.path : C:\Program Files\Java\jdk1.8.0_231\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_231\jre\classes webdriver.chrome.driver : D:\mavenproject\/public/selenium/webdriver/win32/chromedriver.exe java.vendor : Oracle Corporation org.uncommons.reportng.escape-output : false org.uncommons.reportng.title : CS Viewer file.separator : java.vendor.url.bug : http://bugreport.sun.com/bugreport/ idea.test.cyclic.buffer.size : 1048576 sun.cpu.endian : little sun.io.unicode.encoding : UnicodeLittle sun.desktop : windows sun.cpu.isalist : amd64
原文:https://www.cnblogs.com/qiyanse/p/14713724.html