Today I was faced with the challenge of using two JVMs on the same machine. And let me tell you that whenever you have to do this, things get dirty. Basically I was forced to install an additional 32-bit JVM for Rodin, the IDE we use at faculty for Event-B modelling, because the developers of the platform (which is actually a modified Eclipse) decided not to support the 64-bit architectures (LAME!).
Installing a 32-bit JVM on a machine that already has a 64-bit JVM installed will change the default JVM to be the last one installed. Since all of my Java programs and application were made for 64-bit, it was a mayhem on my machine. The solution is rather simple (but, oh, so uncomfortable). You would have to change the default JVM back to the 64-bit one and build some wrapper scripts for all the 32-bit apps to use the correct JVM for them.
Changing the defaults is done in this way:
The first line will instruct your system that there’s another Java version available (the old one) while the second line will make it the default version of JVM.
For Rodin, the wrapper script is pretty trivial, since it’s nothing more than a modified Eclipse IDE:
1 2 3
Everything should be working okay now but don’t forget to instruct the 32-bit apps to use their dedicated JVM. Anyway, keep in mind that this is an ugly hack. If you’re a developer you should better package your apps for all the available architectures and not force your user-base to do this kind of hacks. Don’t forget though that this happens only when some system dependent libraries are used (as is the case for Rodin).