Yes, you can run multiple JVMs on the same machine.
Sun packs jvm startup tools in several ways. Usually you either have the java development kit (jdk), or the standard java (jse) version installed by default. These packages include the java program, which is called to start jvm. In addition, jdk also contains additional commands (e.g. javac ) for developers.
You can have multiple jdk and / jse available on the same machine. On windows, jdk and jse packages are usually installed under Program Files/java (this is from memory, because at the moment I do not have a PC)
On a Mac, see /System/Library/Frameworks/JavaVM.framework/Versions.
On Linux, I would use the which java command to determine where the default java command is installed (usually / usr / bin). Then do ls -al | grep java ls -al | grep java (for example, inside / usr / bin) and note where the point of the symbolic links is to determine where other versions can be installed.
Once you figure out where the various jdk and jse are located on your system, you can start figuring out which version of java is used to run each of the programs.
Each java program is launched using jvm by default. Open a command window or terminal and try java -version determine which version is the current default value.
Instead of using the standard java version, programs can also be launched to use a specific version of java. For example, sometimes I create my own shortcut for Windows to open Eclipse using a specific version of jdk.
Like in java 5, there is a tool called jconsole , which can also help you determine which programs are running, in which versions of jvms. Just open the console and enter jconsole and you will get a good graphical interface that displays all the programs running in jvm by default. I think you can even check out classpaths programs.
Hope this helps, good luck!
Upgradingdave
source share