- First install both the 32 and 64 bit JREs. Use the default installation locations (i.e. 32 bit Java in the Program Files (x86) directory and 64bit Java in the Program Files directory).
- Set the two JAVA_HOME environmental variables: A “JAVA_HOME” variable which points to C:\Program Files\Java\ and a “JAVA_HOME_32” environmental variable which points to C:\Program Files (x86)\Java\.
- Start up all 32 bit java applications using the command: “%JAVA_HOME_32%”\bin\java.exe -cp …
- Make sure you’ve either deliberately specified any needed drivers/dlls using the library.path java command line option (e.g. -Djava.library.path=../lib) or you’ve placed the dependencies in your system path such that there can be no ambiguity about which dll/jar your application will be using. This can be a big issue when you have identically named dependencies in your system32 and sysWOW64 directories. Normally, windows configures it’s path look-up such that it looks in system32 directory first, if running a 64 bit application, and sysWOW64 first, if running a 32 bit application. I believe this priority can be manually configured in some instances.
There are certainly other ways of accomplishing this same functionality, and I’m curious what others are doing. Also, the above configuration allowed me to run two population health java applications simultaneously. Of note: This configuration did not allow me to run a 64 and 32 bit installation of tomcat simultaneously on the same machine (just one at a time).