WEB开发网
开发学院软件开发Java 读取本机的Java运行环境和相关配置文件的内容 阅读

读取本机的Java运行环境和相关配置文件的内容

 2009-09-10 00:00:00 来源:WEB开发网   
核心提示: 得到的test.txt文件的内容:java.runtime.name=Java(TM) SE Runtime Environmentsun.boot.library.path=C:\Program Files\Java\jdk1.6.0_03\jre\binjava.vm.version=1.6

得到的test.txt文件的内容:

java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=C:\Program Files\Java\jdk1.6.0_03\jre\bin
java.vm.version=1.6.0_03-b05
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=;
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.country=CN
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 2
java.vm.specification.name=Java Virtual Machine Specification
user.dir=D:\『Java』Java is not difficult By SunXin\javaLessons\lesson8
java.runtime.version=1.6.0_03-b05
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files\Java\jdk1.6.0_03\jre\lib\endorsed
os.arch=x86
java.io.tmpdir=C:\DOCUME~1\zhangran\LOCALS~1\Temp\
line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
user.variant=
os.name=Windows XP
sun.jnu.encoding=GBK
java.library.path=C:\Program Files\Java\jdk1.6.0_03\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:\apache-tomcat-6.0.10\bin;D:\oracle\product\10.1.0\Db_1\BIN;C:\Program Files\Java\jdk1.6.0_03\bin;d:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client;d:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\PROGRA~1\ATT\Graphviz\bin;;C:\PROGRA~1\ATT\Graphviz\bin;;C:\PROGRA~1\ATT\Graphviz\bin;D:\oracle\product\10.1.0\Db_1\BIN;d:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client;d:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;;C:\Program Files\Java\jdk1.6.0_03\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;d:\Program Files\StormII\Codec;d:\Program Files\StormII;C:\Program Files\SSH Communications Security\SSH Secure Shell;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII;d:\Program Files\StormII\Codec;d:\Program Files\StormII
java.specification.name=Java Platform API Specification
java.class.version=50.0
sun.management.compiler=HotSpot Client Compiler
os.version=5.1
user.home=C:\Documents and Settings\zhangran
user.timezone=
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=GBK
java.specification.version=1.6
user.name=tiger
java.class.path=.;C:\Program Files\Java\jdk1.6.0_03\bin;C:\Program Files\Java\jdk1.6.0_03\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_03\lib\tools.jar;C:\Program Files\Java\jre1.6.0_03\lib\ext\servlet-api.jar;E:\apache-tomcat-6.0.10\lib\servlet-api.jar
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=C:\Program Files\Java\jdk1.6.0_03\jre
java.specification.vendor=Sun Microsystems Inc.
user.language=zh
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode, sharing
java.version=1.6.0_03
java.ext.dirs=C:\Program Files\Java\jdk1.6.0_03\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path=C:\Program Files\Java\jdk1.6.0_03\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_03\jre\classes
java.vendor=Sun Microsystems Inc.
file.separator=\
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

通过test.txt文件内容,可以发现我们自己配置环境变量等信息,也可以知道java运行需要哪些配置信息;这就是我把这些内容贴出来的目的,供学习,参考!

出处: http://yuwenhu.blog.51cto.com/672091/200387

上一页  1 2 

Tags:读取 本机 Java

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接