2010/12/15 - Apache Excalibur has been retired.

For more information, please explore the Attic.

Getting the System Info

Util has one utility: SystemUtil. SystemUtil is a static class that performs its magic when the class is loaded. It stores the information because it is unlikely that you will ever go from one to two processors while your machine is running. The code snippet below demonstrates how to get any and all the relavant information:

public void dumpInfo()
    System.out.println( "Number of Processors: " + SystemUtil.numProcessors() );
    System.out.println( "CPU Info:             " + SystemUtil.cpuInfo() );
    System.out.println( "Architecture:         " + SystemUtil.architecture() );
    System.out.println( "Operating System:     " + SystemUtil.operatingSystem() );
    System.out.println( "OS Version:           " + SystemUtil.osVersion() );

As you can see there is no real mystery here. The method above uses every available SystemUtil method, and it is taken directly from the JUnit TestCase for SystemUtil.