是否可以在 Windows 7 上同时安装 32 位和 64 位 Java?
是否可以在 Windows 7 上同时安装 32 位和 64 位 Java?
我有一些应用程序可以在 64 位下运行,但有些应用程序只能在 32 位下运行。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,绝对没问题。您甚至可以在同一台计算机上同时安装 32 位和 64 位 Java 的多个版本。
其实我自己也有这样的设置。
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.
您可以在 Windows(包括 Windows 7)下安装多个 Java 运行时,只要每个运行时位于各自的目录中即可。
例如,如果您运行的是 Win 7 64 位或 Win Server 2008 R2,则可以在“C:\Program Files (x86)\Java\jre6”中安装 32 位 JRE,在“C:\Program Files (x86)\Java\jre6”中安装 64 位 JRE。 \Program Files\Java\jre6”,也许还有“C:\Program Files (x86)\IBM\Java60\jre”中的 IBM Java 6。
Java 控制面板应用程序理论上能够管理多个运行时:
Java 选项卡>>查看...按钮
有用于用户和系统设置的选项卡。您可以使用“添加”或“查找”来添加其他运行时,但是一旦完成添加运行时并单击“确定”,您必须在主 Java 选项卡框架中单击“应用”,这并不那么明显 - 否则您的更改将丢失。
如果您安装了多个版本,则只有主版本会自动更新。除了每当我看到自动更新时手动更新的弱解决方法之外,我还没有找到解决方案,所以我很想知道是否有人可以解决这个问题。
大多数 Java IDE 允许您选择计算机上的任何 Java 运行时进行构建,但如果不使用 IDE,您可以在 cmd 窗口中使用环境变量轻松管理它。您的 PATH 和 JAVA_HOME 变量确定从 shell 运行的工具使用哪个运行时。将 JAVA_HOME 设置为您想要的 jre 目录,并将 bin 目录放入您的路径(并删除对其他运行时的引用) - 对于 IBM,您可能需要添加多个 bin 目录。这几乎就是默认系统 Java 所做的所有设置。您还可以将 CLASSPATH、ANT_HOME、MAVEN_HOME 等设置为唯一值以匹配您的运行时。
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.
在 Windows 7(64 位操作系统 + 机器)上安装 32 位 Java。你可以这样做:
它使用32位(64位)。我必须使用它,因为许多第三方库不能在 64 位上运行。 Java从地狱中醒来,给我们桃子:P。 Go语言是杀手。
To install 32-bit Java on Windows 7 (64-bit OS + Machine). You can do:
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.
正如 pnt 所说,您可以在同一台计算机上同时安装 32 位和 64 位 Java 的多个版本。
进一步来说:以下是如何为每个安装设置任何运行时参数:
您可以运行相应 Java 版本本身(bin 文件夹)的 javacpl.exe 或 javacpl.cpl。特定的控制面板打开正常。可以添加参数。
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.