How to get System properties using java
The code below shows you how you can get the system properties of a computer using java
import java.io.IOException;
import java.util.Properties;
import java.util.Set;
public class SystemProperties {
/**
* @param args
*/
public static void main(String[] args) {
Properties p = System.getProperties();
p.list(System.out);
}
}
Output
java.home=C:\Program Files\Java\jre6
java.specification.vendor=Sun Microsystems Inc.
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode, sharing
java.version=1.6.0_21
java.ext.dirs=C:\Program Files\Java\jre6\lib\ext;C:...
sun.boot.class.path=C:\Program Files\Java\jre6\lib\resour...
java.vendor=Sun Microsystems Inc.
file.separator=\
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
0 comments:
Post a Comment