Java 和 Eclipse - 32 位与 64 位

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9727430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 06:47:35  来源:igfitidea点击:

Java and Eclipse - 32 vs. 64bit

eclipse64-bitjava

提问by alapeno

I'm a little bit confused about the two different versions of Eclipse - 32/64bit.

我对 Eclipse 的两个不同版本 - 32/64 位有点困惑。

As far as I know, Java bytecode (= build of your code) is platform independend. If a user runs your bytecode in a 32bit JRE, the code is executed in as a 32bit process, if a user runs your bytecode in a 64bit JRE, the code is exectued as a 64bit process.

据我所知,Java 字节码(= 代码的构建)是独立于平台的。如果用户在 32 位 JRE 中运行您的字节码,则代码将作为 32 位进程执行,如果用户在 64 位 JRE 中运行您的字节码,则代码将作为 64 位进程执行。

Eclipse needs the JRE to run, cause it's written in Java. But why are there 32 and 64bit versions of Eclipse on the Eclipse download page if only the user's JRE version does matter?

Eclipse 需要 JRE 才能运行,因为它是用 Java 编写的。但是,如果只有用户的 JRE 版本才重要,为什么 Eclipse 下载页面上会有 32 位和 64 位版本的 Eclipse?

Does a 64bit Eclipse version need a 64bit JRE or JDK? If yes ,why?

64 位 Eclipse 版本是否需要 64 位 JRE 或 JDK?如果是,为什么?



Second confusion: I understand the need for a 32 and 64 bit version of the JRE. But why are there 32 and 64 bit versions of the JDK if the resulting bytecode is platform independet?

第二个困惑:我理解需要 32 位和 64 位版本的 JRE。但是,如果生成的字节码与平台无关,那么为什么会有 32 位和 64 位版本的 JDK?

Thank you

谢谢

采纳答案by Jakub Zaverka

It is not because of the running environment, it is because Eclipse uses some native stuff and must be run on corresponding JDK. The applications you are developing inside Eclipse can then be run on whatever JRE you have installed, just specify it in the settings.

不是因为运行环境的原因,是因为Eclipse使用了一些原生的东西,必须运行在相应的JDK上。您在 Eclipse 中开发的应用程序可以在您安装的任何 JRE 上运行,只需在设置中指定它。

JDK is a compiler and also a lot of other stuff. Many of them are native applications that need to be run corresponding platform.

JDK 是一个编译器,还有很多其他的东西。其中许多是需要运行相应平台的原生应用程序。

回答by Rahul Borkar

Eclipse relies on SWT, which is essentially native code. There will be quite a few DLLs etc. exists (in the plugins or features directories) that will be used by the 64-bit version, that are drastically different from the 32-bit version.

Eclipse 依赖于 SWT,它本质上是本机代码。64 位版本将使用相当多的 DLL 等(在插件或功能目录中),它们与 32 位版本截然不同。