在 64 位 JVM 上运行的 Eclipse 32 位

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3785530/
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-09-19 15:09:01  来源:igfitidea点击:

Eclipse 32 bits running on 64 bits JVM

javaeclipse64-bitjvm

提问by Manuel Selva

After many investigations I can't find a clear answer to the following question: Can Eclipse 32 bits version runs on a 64 bits JVM (of course on a 64 bits windows) ?

经过多次调查,我找不到以下问题的明确答案:Eclipse 32 位版本能否在 64 位 JVM 上运行(当然在 64 位 Windows 上)?

I guess the answer should be "NO" but I never worked with 64 bits systems and will be interested to "learn more" of how it work.

我想答案应该是“否”,但我从未使用过 64 位系统,并且有兴趣“了解更多”它是如何工作的。

Thanks in advance,

提前致谢,

Manu

摩奴

回答by Michael Borgwardt

No, that's not possible, because Eclipse's SWT GUI toolkit depends on native libraries (which is the reason there are separate 32 and 64bit version of eclipse in the first place), and you cannot call 32bit native libraries from a 64bit JVM(or, in general, you cannot mix 64bit and 32bit code within the same OS process).

不,这是不可能的,因为 Eclipse 的 SWT GUI 工具包依赖于本机库(这就是首先有 32 位和 64 位版本的 eclipse 的原因),并且您不能从 64 位 JVM 调用 32 位本机库(或者,在一般情况下,您不能在同一个操作系统进程中混合使用 64 位和 32 位代码)。

回答by Peter Lawrey

You don't need eclipse to be running as 64-bit unless you intend to use well over 1 GB for the IDE. You can use eclipse to develop 64-bit applications by configuring it to use a 64-bit JVM when running your application.

除非您打算为 IDE 使用超过 1 GB 的空间,否则您不需要 eclipse 以 64 位运行。您可以使用 Eclipse 来开发 64 位应用程序,方法是将其配置为在运行应用程序时使用 64 位 JVM。

Note: Java switches between 32-bit and 64-bit transparently (not as simple for native libraries but this can be done also) This means that developing for a 64-bit application looks and smells exactly the same as a 32-bit application. All you get is the warm inner feeling knowing that you are using 64-bit machine code and a bit more memory. Note: using CompressedOops reduces the memory overhead at the cost of some CPU overhead.

注意:Java 在 32 位和 64 位之间透明地切换(对于本机库来说并不那么简单,但这也可以做到)这意味着为 64 位应用程序开发的外观和气味与 32 位应用程序完全相同。知道您使用的是 64 位机器代码和更多内存,您所得到的只是温暖的内在感觉。注意:使用 CompressedOops 会以一些 CPU 开销为代价来减少内存开销。

If you need to use more than a few GB of memory, that is when 64-bit make a difference, but your code will be exactly the same and no re-compile is required.

如果您需要使用超过几 GB 的内存,那么 64 位就会有所不同,但您的代码将完全相同,无需重新编译。

回答by keshav84


I have been using a 32 bit version on 64 version for quite some time and have not faced any problem till now.
In most of the cases running a 32 bit version on 64 bit version should not be a problem but the other way would be a problem.


我在 64 位版本上使用 32 位版本已经有一段时间了,直到现在还没有遇到任何问题。
在大多数情况下,在 64 位版本上运行 32 位版本应该没有问题,但其他方式就会有问题。

BR, Keshav

BR, 凯沙夫

回答by Nik

Also, running in 64 bit will add an unnecessary overhead of 5-8%. Right now, 64 bit JVM should only be used for server programs needing large chunck of working memory.

此外,以 64 位运行会增加 5-8% 的不必要开销。现在,64 位 JVM 应该只用于需要大量工作内存的服务器程序。