可以在Windows 7上同时安装32位和64位Java吗?

时间:2021-07-14 22:35:59

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

可以在Windows 7上同时安装32位和64位Java吗?

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

我有一些应用程序可以在64位下运行,但也有一些应用程序只能在32位下运行。

4 个解决方案

#1


71  

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.

是的,绝对没问题。您甚至可以在同一台计算机上同时安装32位和64位Java的多个版本。

In fact, i have such a setup myself.

事实上,我自己也有这样的安排。

#2


20  

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

您可以在Windows(包括Windows 7)下安装多个Java运行时,只要每个运行时都在它们自己的目录中。

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".

例如,如果您正在运行Win 7 64位,或者Win Server 2008 R2,那么您可以在“C:\程序文件(x86)\Java\jre6”和64位JRE中安装32位JRE,在“C:\程序文件\Java\jre6”中,或者在“C:\程序文件(x86)\IBM\Java60\ JRE”中使用IBM Java6。

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

Java控制面板应用程序理论上可以管理多个运行时:Java tab >>视图…按钮

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.

有用户和系统设置的选项卡。您可以使用add或Find添加额外的运行时,但是一旦您完成添加运行时并单击OK,您就必须在主Java选项卡框架中单击Apply,这并不像它可能的那样明显——否则您的更改将丢失。

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.

大多数Java IDE允许您选择机器上的任何Java运行时来构建,但是如果不使用IDE,您可以使用cmd窗口中的环境变量轻松地管理它。路径和JAVA_HOME变量决定从shell运行的工具使用哪个运行时。将JAVA_HOME设置为所需的jre目录,并将bin目录放入路径中(并删除对其他运行时的引用)——使用IBM,您可能需要添加多个bin目录。这几乎是默认系统Java所做的所有设置。您还可以将CLASSPATH、ANT_HOME、MAVEN_HOME等设置为惟一值,以匹配您的运行时。

#3


2  

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

在Windows 7(64位OS + Machine)上安装32位Java。你能做什么:

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.

它使用32位(64位)。我必须使用它,因为许多第三方库不能使用64位。Java从地狱中醒来,给我们桃子:P。go语言是杀手。

#4


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.

如pnt所述,您可以同时在同一台机器上安装32位和64位Java的多个版本。

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.

您可以运行javacpl。exe或javacpl。各自的java版本本身的cpl (bin-folder)。特定的控制面板打开良好。添加参数是可能的。

#1


71  

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.

是的,绝对没问题。您甚至可以在同一台计算机上同时安装32位和64位Java的多个版本。

In fact, i have such a setup myself.

事实上,我自己也有这样的安排。

#2


20  

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

您可以在Windows(包括Windows 7)下安装多个Java运行时,只要每个运行时都在它们自己的目录中。

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".

例如,如果您正在运行Win 7 64位,或者Win Server 2008 R2,那么您可以在“C:\程序文件(x86)\Java\jre6”和64位JRE中安装32位JRE,在“C:\程序文件\Java\jre6”中,或者在“C:\程序文件(x86)\IBM\Java60\ JRE”中使用IBM Java6。

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

Java控制面板应用程序理论上可以管理多个运行时:Java tab >>视图…按钮

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.

有用户和系统设置的选项卡。您可以使用add或Find添加额外的运行时,但是一旦您完成添加运行时并单击OK,您就必须在主Java选项卡框架中单击Apply,这并不像它可能的那样明显——否则您的更改将丢失。

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.

大多数Java IDE允许您选择机器上的任何Java运行时来构建,但是如果不使用IDE,您可以使用cmd窗口中的环境变量轻松地管理它。路径和JAVA_HOME变量决定从shell运行的工具使用哪个运行时。将JAVA_HOME设置为所需的jre目录,并将bin目录放入路径中(并删除对其他运行时的引用)——使用IBM,您可能需要添加多个bin目录。这几乎是默认系统Java所做的所有设置。您还可以将CLASSPATH、ANT_HOME、MAVEN_HOME等设置为惟一值,以匹配您的运行时。

#3


2  

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

在Windows 7(64位OS + Machine)上安装32位Java。你能做什么:

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.

它使用32位(64位)。我必须使用它,因为许多第三方库不能使用64位。Java从地狱中醒来,给我们桃子:P。go语言是杀手。

#4


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.

如pnt所述,您可以同时在同一台机器上安装32位和64位Java的多个版本。

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.

您可以运行javacpl。exe或javacpl。各自的java版本本身的cpl (bin-folder)。特定的控制面板打开良好。添加参数是可能的。