使用64位和32位JDK

时间:2023-01-03 12:26:36

I have a system running 64bit windows 7. I'm doing a project using JMF, which I found works best (or only) with 32 bit jdk. I'm using a 32bit eclipse. I also have a 64bit JDK installed. right now I have set classpath (JAVA_HOME and Path) for the 32bit JDK.

我有一个运行64位Windows 7的系统。我正在使用JMF做一个项目,我发现它最好(或者只有)32位jdk。我正在使用32位日食。我也安装了64位JDK。现在我已经为32位JDK设置了classpath(JAVA_HOME和Path)。

The problem is it becomes hectic to switch between the 64bit and 32 bit JDK(i have to change classpaths everytime). Is there any easier way to do that?

问题是在64位和32位JDK之间切换变得忙乱(我必须每次更改类路径)。有没有更简单的方法呢?

4 个解决方案

#1


4  

You can have multiple JREs registered with Eclipse, and associate a project or run configuration with a specific JRE. These are different from the JRE you use to run Eclipse in.

您可以在Eclipse中注册多个JRE,并将项目或运行配置与特定JRE相关联。这些与用于运行Eclipse的JRE不同。

#2


2  

Eclipse doesn't need to depend on JAVA_HOME or PATH. You can specify the JVM to be used to run Eclipse in the eclipse.ini file, and specify the path(s) to the target JVM(s) via the Eclipse preferences.

Eclipse不需要依赖JAVA_HOME或PATH。您可以在eclipse.ini文件中指定用于运行Eclipse的JVM,并通过Eclipse首选项指定目标JVM的路径。

If you have to run both 32 and 64 bit Java from the command line, you should invest some time in writing shell scripts, aliases, etc.

如果必须从命令行运行32位和64位Java,则应该花一些时间编写shell脚本,别名等。

  • You could write a script (to be executed using ".") that will switch the settings of PATH and JAVA_HOME.

    您可以编写一个脚本(使用“。”执行),它将切换PATH和JAVA_HOME的设置。

  • I prefer the approach of writing simple wrapper scripts or aliases to automate the build or run steps for the software you are developing. You can embed local overrides of PATH and JAVA_HOME in these scripts.

    我更喜欢编写简单包装脚本或别名的方法来自动化正在开发的软件的构建或运行步骤。您可以在这些脚本中嵌入PATH和JAVA_HOME的本地覆盖。

#3


0  

I would suggest just keep one JDK installed on your machine.

我建议你在你的机器上安装一个JDK。

If you are working with JMF and Eclipse 32 bit then uninstall 64bit JDK

如果您正在使用JMF和Eclipse 32位,请卸载64位JDK

As per Oracle.

按照Oracle。

使用64位和32位JDK

#4


0  

To run 64 bit eclipse without change environment variable

在不改变环境变量的情况下运行64位eclipse

Simply copy 64bit jre to your eclipse(64 bit) root folder and rename it as jre.

只需将64位jre复制到您的eclipse(64位)根文件夹并将其重命名为jre。

#1


4  

You can have multiple JREs registered with Eclipse, and associate a project or run configuration with a specific JRE. These are different from the JRE you use to run Eclipse in.

您可以在Eclipse中注册多个JRE,并将项目或运行配置与特定JRE相关联。这些与用于运行Eclipse的JRE不同。

#2


2  

Eclipse doesn't need to depend on JAVA_HOME or PATH. You can specify the JVM to be used to run Eclipse in the eclipse.ini file, and specify the path(s) to the target JVM(s) via the Eclipse preferences.

Eclipse不需要依赖JAVA_HOME或PATH。您可以在eclipse.ini文件中指定用于运行Eclipse的JVM,并通过Eclipse首选项指定目标JVM的路径。

If you have to run both 32 and 64 bit Java from the command line, you should invest some time in writing shell scripts, aliases, etc.

如果必须从命令行运行32位和64位Java,则应该花一些时间编写shell脚本,别名等。

  • You could write a script (to be executed using ".") that will switch the settings of PATH and JAVA_HOME.

    您可以编写一个脚本(使用“。”执行),它将切换PATH和JAVA_HOME的设置。

  • I prefer the approach of writing simple wrapper scripts or aliases to automate the build or run steps for the software you are developing. You can embed local overrides of PATH and JAVA_HOME in these scripts.

    我更喜欢编写简单包装脚本或别名的方法来自动化正在开发的软件的构建或运行步骤。您可以在这些脚本中嵌入PATH和JAVA_HOME的本地覆盖。

#3


0  

I would suggest just keep one JDK installed on your machine.

我建议你在你的机器上安装一个JDK。

If you are working with JMF and Eclipse 32 bit then uninstall 64bit JDK

如果您正在使用JMF和Eclipse 32位,请卸载64位JDK

As per Oracle.

按照Oracle。

使用64位和32位JDK

#4


0  

To run 64 bit eclipse without change environment variable

在不改变环境变量的情况下运行64位eclipse

Simply copy 64bit jre to your eclipse(64 bit) root folder and rename it as jre.

只需将64位jre复制到您的eclipse(64位)根文件夹并将其重命名为jre。