Java examples for Native OS:Environment
Get Available Processors
public class Main { public static void main(String args[]) { Runtime runtime = Runtime.getRuntime(); int numberOfProcessors = runtime.availableProcessors(); System.out.println(numberOfProcessors + " processor available to JVM"); }//from w ww . jav a 2 s .c om }