This should not be controlled at the JVM / Java level, but at the OS / platform level. On Windows, for example, you can go to the "Processes" tab in the task manager and set up "Affinity" for most processes by selecting the appropriate option in the right-click menu. In doing so, you basically control which processors / cores can process the process.
source
share