Tutorial Addendum On Java - Beheading Ambiance

wargamesios kidsgamesios wordgamesios
 31 December 18:00   

    



    



    

System Properties

    



    

Java appliance programs are accomplished central a Java Basic Apparatus (JVM),

    

which is in turn

    

executed central an Operating Arrangement (OS). From the Java appliance program point of view,

    

the JVM, calm with the OS, represents the computer system. The backdrop of

    

the JVM and the OS are all alleged arrangement properties.

    



    

A Java appliance program can:

    



        

  • Use System.getProperty(String propertyName) to get the amount of a specific system

        

    property.

        



  •     

  • Use System.getProperties() to the ethics of all accessible arrangement properties.

        



  •     



    



    

Here is an archetype program that displays the ethics of all accessible arrangement properties:

    

 

    

/**

    

* SysProperties.java

    

* Absorb (c) 2002 by Dr. Yang

    

*/

    

import java.util.*;

    

public chic SysProperties {

    

accessible changeless abandoned main(String[] a) {

    

Backdrop sysProps = System.getProperties();

    

sysProps.list(System.out);

    

}

    

}

    



    



    

Output:

    

 

    

-- advertisement backdrop --

    

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

    

sun.boot.library.path=C:j2sdk1.4.1_01jrein

    

java.vm.version=1.4.1_01-b01

    

java.vm.vendor=Sun Microsystems Inc.

    

java.vendor.url=http://java.sun.com/

    

path.separator=;

    

java.vm.name=Java HotSpot(TM) Applicant VM

    

file.encoding.pkg=sun.io

    

user.country=US

    

sun.os.patch.level=Service Backpack 2

    

java.vm.specification.name=Java Basic Apparatus Specification

    

user.dir=C:\java

    

java.runtime.version=1.4.1_01-b01

    

java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment

    

java.endorsed.dirs=C:j2sdk1.4.1_01jrelibendorsed

    

os.arch=x86

    

java.io.tmpdir=C:DOCUME~1\LOCALS~1Temp

    

line.separator=

    

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

    

user.variant=

    

os.name=Windows 2000

    

sun.java2d.fontpath=

    

java.library.path=C:j2sdk1.4.1_01in;.;C:WINNT...

    

java.specification.name=Java Belvedere API Specification

    

java.class.version=48.0

    

java.util.prefs.PreferencesFactory

    

=java.util.prefs.WindowsPreferencesFac...

    

os.version=5.0

    

user.home=C:Documents and Settings

user.timezone=

    

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

    

file.encoding=Cp1252

    

java.specification.version=1.4

    

user.name=

    

java.class.path=.

    

java.vm.specification.version=1.0

    

sun.arch.data.model=32

    

java.home=C:j2sdk1.4.1_01jre

    

java.specification.vendor=Sun Microsystems Inc.

    

user.language=en

    

awt.toolkit=sun.awt.windows.WToolkit

    

java.vm.info=mixed mode

    

java.version=1.4.1_01

    

java.ext.dirs=C:j2sdk1.4.1_01jrelibext

    

sun.boot.class.path=C:j2sdk1.4.1_01jrelib
t.jar...

    

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=pentium i486 i386

    



    



    

Note that:

    



        

  • The amount of acreage "line.separator" contains a new band appearance
    ,

        

    which produces a bare band on the achievement window.

        



  •     

  • The Properties.list() truncates ethics afterwards 37 characters while sending them

        

    to the achievement stream.

        



  •     



    

 


Tags: program, system, windows, application, class, machine, available, environment, values, properties

 system, version, properties, j2sdk1, specification, vendor, separator, microsystems, class, encoding, windows, runtime, application, program, values, environment, , name java, microsystems inc, sun microsystems, vendor sun, sun awt, separator java, java vendor, system properties, specification name java, available system properties, java application program, java virtual machine, java execution environment,

Share Tutorial Addendum On Java - Beheading Ambiance:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  java