今天用到了System.getProperty("user.dir") 同时想了解一下System.getProperty()究竟还有什么参数, 先上网搜了一下,结果n个弯也内容如下:
java.version |
Java Runtime Environment version |
java.vendor |
Java Runtime Environment vendor |
java.vendor.url |
Java vendor URL |
java.home |
Java installation directory |
java.vm.specification.version |
Java Virtual Machine specification version |
java.vm.specification.vendor |
Java Virtual Machine specification vendor |
java.vm.specification.name |
Java Virtual Machine specification name |
java.vm.version |
Java Virtual Machine implementation version |
java.vm.vendor |
Java Virtual Machine implementation vendor |
java.vm.name |
Java Virtual Machine implementation name |
java.specification.version |
Java Runtime Environment specification version |
java.specification.vendor |
Java Runtime Environment specification vendor |
java.specification.name |
Java Runtime Environment specification name |
java.class.version |
Java class format version number |
java.class.path |
Java class path |
java.library.path |
List of paths to search when loading libraries |
java.io.tmpdir |
Default temp file path |
java.compiler |
Name of JIT compiler to use |
java.ext.dirs |
Path of extension directory or directories |
os.name |
Operating system name |
os.arch |
Operating system architecture |
os.version |
Operating system version |
file.separator |
File separator ("/" on UNIX) |
path.separator |
Path separator (":" on UNIX) |
line.separator |
Line separator ("\n" on UNIX) |
user.name |
User's account name |
user.home |
User's home directory |
user.dir |
User's current working directory |
一共28个,于是自己写了一个小东西测试一下,结果如下:
java.runtime.name
sun.boot.library.path
java.vm.version
java.vm.vendor
java.vendor.url
path.separator
java.vm.name
file.encoding.pkg
user.country
sun.java.launcher
sun.os.patch.level
java.vm.specification.name
user.dir
java.runtime.version
java.awt.graphicsenv
java.endorsed.dirs
os.arch
java.io.tmpdir
line.separator
java.vm.specification.vendor
user.variant
os.name
sun.jnu.encoding
java.library.path
java.specification.name
java.class.version
sun.management.compiler
os.version
user.home
user.timezone
java.awt.printerjob
file.encoding
java.specification.version
user.name
java.class.path
java.vm.specification.version
sun.arch.data.model
java.home
java.specification.vendor
user.language
awt.toolkit
java.vm.info
java.version
java.ext.dirs
sun.boot.class.path
java.vendor
file.separator
java.vendor.url.bug
sun.cpu.endian
sun.io.unicode.encoding
sun.desktop
sun.cpu.isalist
******************共计 :52 个!*******************
但愿java的计数器别出错!
出入很大啊!现在给出代码啦!
1 import java.util.*;
2
3 public class TestProperty{
4 public static void main(String[] agrs){
5 Properties properties = System.getProperties();
6 int i = 0;
7 for (Enumeration e = properties.propertyNames(); e.hasMoreElements() ;) {
8 System.out.println(e.nextElement());
9 i++;
10 }
11
12 System.out.println("******************共计 :"+i+" 个!*******************");
13 System.out.println("==================具体含义自己看!====================");
14
15 for (Enumeration e = properties.propertyNames(); e.hasMoreElements() ;) {
16 String str = e.nextElement().toString();
17 System.out.println("key = "+str+" || value = "+System.getProperty(str));
18 }
19
20 }
21 }
嘿嘿!现丑了!!
posted on 2007-10-25 09:56
lk 阅读(1097)
评论(0) 编辑 收藏 所属分类:
j2se