Skip to content

Tag: java.util

Java, listing system properties

This code prints out your system properties.

import java.util.Properties;

public class PropertiesLister{
   public static void main (String args[]){
       Properties props = System.getProperties();
       props.list(System.out);
   }
}

In the machine I’m writing right now:

— listing properties —
java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
java.vm.version=1.6.0-b105
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=:
java.vm.name=Java HotSpot(TM) Server VM
file.encoding.pkg=sun.io
user.country=BR
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/tmp
java.runtime.version=1.6.0-b105
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.endorsed.dirs=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
os.arch=i386
java.io.tmpdir=/tmp
line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.jnu.encoding=UTF-8
java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
java.specification.name=Java Platform API Specification
java.class.version=50.0
sun.management.compiler=HotSpot Server Compiler
os.version=2.6.20-16-generic
user.home=/home/export/silveira
user.timezone=
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=UTF-8
java.specification.version=1.6
user.name=silveira
java.class.path=.
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=/usr/lib/jvm/java-6-sun-1.6.0.00/jre
java.specification.vendor=Sun Microsystems Inc.
user.language=pt
java.vm.info=mixed mode
java.version=1.6.0
java.ext.dirs=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
sun.boot.class.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
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.cpu.isalist=

Try out at your home. 🙂