分享
 
 
 

Java 2 Runtime Environment

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

今天有人问我Java Runtime 的一些属性,就索性敲了几行代码。

import java.util.*;

public class GetSysProperty {

public static void main(String[] args) {

int s = System.getProperties().size();

System.out.println("System Properties Number: " + s + "\r\n");

Enumeration e = System.getProperties().keys();

Collection v = System.getProperties().values();

for (Iterator iter = v.iterator(); iter.hasNext(); e.hasMoreElements()) {

System.out.println(prtSpace(e.nextElement().toString()) + " = "

+ iter.next());

}

}

public static String prtSpace(String s) {

int LENGTH = 40;

int nLen = s.length();

int sLen = LENGTH - nLen;

if (sLen > 0) {

for (int i = 0; i < sLen; i++) {

s += " ";

}

}

return s;

}

}

一个运行实例:

System Properties Number: 50

java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition

sun.boot.library.path = C:\Program Files\Java\j2re1.4.2\bin

java.vm.version = 1.4.2-b28

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.os.patch.level = Service Pack 4

java.vm.specification.name = Java Virtual Machine Specification

user.dir = D:\eww\test

java.runtime.version = 1.4.2-b28

java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment

java.endorsed.dirs = C:\Program Files\Java\j2re1.4.2\lib\endorsed

os.arch = x86

java.io.tmpdir = C:\DOCUME~1\ADMINI~1\LOCALS~1\Templine.separator =

java.vm.specification.vendor = Sun Microsystems Inc.

user.variant =

os.name = Windows 2000

sun.java2d.fontpath =

java.library.path = C:\Program Files\Java\j2re1.4.2\bin;.;C:\WINNT\system32;C:\WINNT;c:\oracle\ora90\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;D:\j2sdk1.4.2\bin;D:\UnxUtils\usr\local\wbin;C:\PROGRA~1\TCL\bin

java.specification.name = Java Platform API Specification

java.class.version = 48.0

java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory

os.version = 5.0

user.home = C:\Documents and Settings\Administrator

user.timezone =

java.awt.printerjob = sun.awt.windows.WPrinterJob

file.encoding = GBK

java.specification.version = 1.4

java.class.path = D:\eww\test\bin;D:\lib\ABS.jar;D:\lib\activation.jar;D:\lib\axis.jar;D:\lib\axis-ant.jar;D:\lib\commons-beanutils.jar;D:\lib\commons-codec-1.1.jar;D:\lib\commons-collections.jar;D:\lib\commons-dbcp.jar;D:\lib\commons-digester.jar;D:\lib\commons-discovery.jar;D:\lib\commons-fileupload.jar;D:\lib\commons-lang.jar;D:\lib\commons-lang-2.0.jar;D:\lib\commons-logging.jar;D:\lib\commons-pool.jar;D:\lib\commons-resources.jar;D:\lib\commons-validator.jar;D:\lib\cos.jar;D:\lib\dfbeans.jar;D:\lib\dfmerp.jar;D:\lib\jakarta-oro.jar;D:\lib\jakarta-oro-2.0.6.jar;D:\lib\jakarta-poi-1.9.0-dev-20030109.jar;D:\lib\jaxrpc.jar;D:\lib\jcms_sysinfo.jar;D:\lib\jconn2.jar;D:\lib\jdom.jar;D:\lib\ldapMd5.jar;D:\lib\LDAPpart.jar;D:\lib\log4j-1.2.8.jar;D:\lib\lucene_cn.jar;D:\lib\lucene-demos-20030724.jar;D:\lib\mail.jar;D:\lib\msbase.jar;D:\lib\mssqlserver.jar;D:\lib\msutil.jar;D:\lib\news_filter.jar;D:\lib\nls_charset12.jar;D:\lib\nntp.jar;D:\lib\OaBasicClass.jar;D:\lib\oracle12.jar;D:\lib\platform.jar;D:\lib\saaj.jar;D:\lib\servlet.jar;D:\lib\sprinta2000_enterprise.jar;D:\lib\velocity-dep-1.4.jar;D:\lib\workflow.jar;D:\lib\workflowserver.jar;D:\lib\wsdl4j.jar;D:\lib\allmodal.jar;D:\lib\jcms_luc.jar;D:\lib\junit.jar;D:\lib\jrlib.jar;D:\lib\mysql-connector-java-3.1.4-beta-bin.jar

user.name = Administrator

java.vm.specification.version = 1.0

java.home = C:\Program Files\Java\j2re1.4.2

sun.arch.data.model = 32

user.language = zh

java.specification.vendor = Sun Microsystems Inc.

awt.toolkit = sun.awt.windows.WToolkit

java.vm.info = mixed mode

java.version = 1.4.2

java.ext.dirs = C:\Program Files\Java\j2re1.4.2\lib\ext

sun.boot.class.path = C:\Program Files\Java\j2re1.4.2\lib\rt.jar;C:\Program Files\Java\j2re1.4.2\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2\lib\jce.jar;C:\Program Files\Java\j2re1.4.2\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2\classes

java.vendor = Sun Microsystems Inc.

file.separator = java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi

sun.io.unicode.encoding = UnicodeLittle

sun.cpu.endian = little

sun.cpu.isalist = pentium i486 i386

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有