The java.lang.Runtime.availableProcessors() method returns the number of processors available to the Java virtual machine.This value may change during a Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the availableProcessors
int cores = Runtime.getRuntime().availableProcessors();
If cores is less than one, either your processor is about to die, or your JVM has a serious bug in it, or the universe is about to blow up.
The java.lang.Runtime.availableProcessors() method returns the number of processors available to the Java virtual machine.This value may change during a Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the availableProcessors
int cores = Runtime.getRuntime().availableProcessors();
If cores is less than one, either your processor is about to die, or your JVM has a serious bug in it, or the universe is about to blow up.