Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to install both 32bit and 64bit Java on Windows 7?

Is it possible to install both 32bit and 64bit Java on Windows 7?

I have some applications that I can run under 64bit, but there are some that only run under 32bit.

like image 851
moleculezz Avatar asked Mar 11 '11 11:03

moleculezz


People also ask

Do I need both 32-bit and 64-bit Java?

64 bit gives much better performance in most apps and it shouldn't matter if the launching program is 32 bit, it can still run the 64 bit java.

Can I run 32-bit Java on 64-bit Windows?

However you cannot run 64bits program if your OS and IE belong to a 32bit architecture. Also you will not be able to install programs belonging to both bits on the same laptop. This will make the 32bit Java run but will not work for 64. Was this reply helpful?

Does Windows 7 support 32bit or 64bit?

3.32-bit Windows 7 can be installed on 32-bit and 64-bit processors while 64-bit Windows 7 requires a 64-bit processor.


2 Answers

Yes, it is absolutely no problem. You could even have multiple versions of both 32bit and 64bit Java installed at the same time on the same machine.

In fact, i have such a setup myself.

like image 135
pnt Avatar answered Sep 24 '22 12:09

pnt


You can install multiple Java runtimes under Windows (including Windows 7) as long as each is in their own directory.

For example, if you are running Win 7 64-bit, or Win Server 2008 R2, you may install 32-bit JRE in "C:\Program Files (x86)\Java\jre6" and 64-bit JRE in "C:\Program Files\Java\jre6", and perhaps IBM Java 6 in "C:\Program Files (x86)\IBM\Java60\jre".

The Java Control Panel app theoretically has the ability to manage multiple runtimes: Java tab >> View... button

There are tabs for User and System settings. You can add additional runtimes with Add or Find, but once you have finished adding runtimes and hit OK, you have to hit Apply in the main Java tab frame, which is not as obvious as it could be - otherwise your changes will be lost.

If you have multiple versions installed, only the main version will auto-update. I have not found a solution to this apart from the weak workaround of manually updating whenever I see an auto-update, so I'd love to know if anyone has a fix for that.

Most Java IDEs allow you to select any Java runtime on your machine to build against, but if not using an IDE, you can easily manage this using environment variables in a cmd window. Your PATH and the JAVA_HOME variable determine which runtime is used by tools run from the shell. Set the JAVA_HOME to the jre directory you want and put the bin directory into your path (and remove references to other runtimes) - with IBM you may need to add multiple bin directories. This is pretty much all the set up that the default system Java does. You can also set CLASSPATH, ANT_HOME, MAVEN_HOME, etc. to unique values to match your runtime.

like image 41
user1164178 Avatar answered Sep 25 '22 12:09

user1164178