82

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.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
moleculezz
  • 7,513
  • 4
  • 25
  • 25
  • And what about your **Windows 7**? **32 bit or 64 bit** ? – Vikas Patidar Mar 11 '11 at 11:25
  • 2
    He said he's running 64 bit applications. – z7sg Ѫ Mar 11 '11 at 11:30
  • @z7sg: Though I thought same thing but still the first line in very unclear and in the second one he's said that `some applications that I can run under 64bit` then why can't it be a Java 64 bit to run apps that's why I was confused. :-) – Vikas Patidar Mar 11 '11 at 11:39
  • 3
    This question is particularly relevant since Chrome *still* does not have a 64-bit version for Windows. In this case, you may end up having to install *both* versions: 64-bit for Java programs run in the OS, and 32-bit for web applets run in Chrome. `◔_◔` – Synetech Mar 12 '13 at 22:36

4 Answers4

73

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.

pnt
  • 1,916
  • 1
  • 20
  • 29
  • 5
    How do I go about the installation process? Just install in different directories? – moleculezz Mar 11 '11 at 11:29
  • 4
    Yes, you just install them in different directories. By default, the installation will choose a folder name that contains the version in it, so they should be unique (=> different) by default. Additionally, you could adjust your PATH environment variable to point to whichever version you would like to use when you use the command line. – pnt Mar 11 '11 at 11:37
  • So in other words, if you use Chrome on a 64-bit machine, then just install the 32-bit JVM. `ಠ_ಠ` – Synetech Mar 12 '13 at 22:37
  • I have adjust PATH environment variable but it wont work for me . After some research I found this http://stackoverflow.com/questions/5250806/java-exe-always-point-to-the-path-of-jre-but-not-jdk but I dont want to edit registry. And unable to get what junction is all about. Can any one help me ? – anasanjaria Mar 23 '13 at 18:12
20

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.

user1164178
  • 410
  • 5
  • 5
  • 3
    No, the 64-bit Java Control panel WILL NOT manage 32-bit JVMs on the system. I wish it would, that would be awesome to be able to toggle between a default 64bit JVM to a 32bit JVM. Unfortunately, we're out of luck. – djangofan Aug 20 '12 at 22:48
2

To install 32-bit Java on Windows 7 (64-bit OS + Machine). You can do:

1) Download JDK: http://javadl.sun.com/webapps/download/AutoDL?BundleId=58124
2) Download JRE: http://www.java.com/en/download/installed.jsp?jre_version=1.6.0_22&vendor=Sun+Microsystems+Inc.&os=Linux&os_version=2.6.41.4-1.fc15.i686

3) System variable create: C:\program files (x86)\java\jre6\bin\

4) Anywhere you type java -version

it use 32-bit on (64-bit). I have to use this because lots of third party libraries do not work with 64-bit. Java wake up from the hell, give us peach :P. Go-language is killer.

0

As stated by pnt you can have multiple versions of both 32bit and 64bit Java installed at the same time on the same machine.

Taking it further from there: Here's how it might be possible to set any runtime parameters for each of those installations:

You can run javacpl.exe or javacpl.cpl of the respective Java-version itself (bin-folder). The specific control panel opens fine. Adding parameters there is possible.

rzwarg
  • 1
  • 2
  • Hello, welcome to SO. This seems to be both an answer (although repeating another one) and a new question. This is not a forum, it's a Q&A site. I recommend to take a [tour] of the site. There's a strong separation between questions and answers. If you have another question, please ask it separately, maybe adding a link to this one. Thank you! – Fabio says Reinstate Monica Sep 15 '16 at 09:53
  • 1
    Actually it's a comment to djangofan's remark "the 64-bit Java Control panel WILL NOT manage 32-bit JVMs on the system". But SO's policies won't let me comment until I have 50 reputations. A new question would open a new thread and I think it belongs here. An answer was the only way to post an idea I think is worth sharing. I edited my answer to seem less of a question. – rzwarg Sep 15 '16 at 10:47