简体   繁体   English

32/64位日食

[英]32/64 bit eclipse

  • On 64-bit openSUSE Linux, can a 32-bit eclipse running with 32-bit JVM compile code for a 64-bit system? 在64位openSUSE Linux上,运行32位JVM的32位eclipse是否可以为64位系统编译代码?

  • Is this setup possible? 这种设置可行吗? (Installing and running eclipse/java 32-bit on a 64-bit system) (在64位系统上安装和运行eclipse / java 32位)

If you're building pure Java, there's no such thing as compiling for a particular architecture - Java bytecode is portable across CPU architectures and 32/64-bitness. 如果您正在构建纯Java,则不需要为特定体系结构进行编译 - Java字节码可跨CPU架构和32/64位进行移植。

If you want to compile another language (such as C++) then it gets a bit harder. 如果你想编译另一种语言(比如C ++)那么它会变得有点困难。 Likewise you may find problems if you try to build JNI wrappers for one architecture on another. 同样,如果您尝试在另一个体系结构上构建JNI包装器,则可能会发现问题。

When you compile in Java there is no notions of 32/64bits it's just java Bytecode. 当你用Java编译时,没有32 / 64bits的概念,它只是java Bytecode。 So yes, you can compile java in a 32bits environment and run it in a 64bits one. 所以,是的,您可以在32位环境中编译java并以64位运行它。

The compiled Java program is always identical as Java runs through the Java virtual machine which handles the architecture and native calls. 编译的Java程序总是相同的,因为Java运行在处理体系结构和本机调用的Java虚拟机上。 A Java program is not fully compiled all the way to machine code, only up to bytecode for the virtual machine. Java程序没有完全编译到机器代码,只有虚拟机的字节码。 This means that a Java program can work on any architecture. 这意味着Java程序可以在任何架构上运行。

The crucial point is the JVM you choose to run Eclipse iwth and your final program. 关键点是您选择运行Eclipse iwth的JVM和最终程序。

If all your code is Java then the result can run on either. 如果您的所有代码都是Java,则结果可以在任何一个上运行。 The most visible difference is the amount of memory that a program can actually use, where the 64-bit JVM allows for more than the 32-bit JVM. 最明显的区别是程序实际可以使用的内存量,其中64位JVM允许的内存量超过32位JVM。

As i remember there are some XUL library which depends of processor architecture. 我记得有一些XUL库依赖于处理器架构。

So the way you need is emulate/virtualize eclipse environment x86 to run inside of x64 environment. 因此,您需要的方式是模拟/虚拟化eclipse环境x86以在x64环境中运行。

So the most expected exception should be XUL libraries error. 所以最期望的异常应该是XUL库错误。

And one another life-hack could be switching to x64 libraries in x86 eclipse package, but its not guaranteed. 另一个生活黑客可能会在x86 eclipse包中切换到x64库,但不能保证。

So, try to install x86 eclipse application to your environment and post here logs. 因此,尝试将x86 eclipse应用程序安装到您的环境并在此处发布日志。

Regards Eugene 关心尤金

Check answers for question Java programing for 64 bit JVM 检查64位JVM的Java编程问题的答案

It should not matter when you compile java code whether you compile for 32/64 bit. 无论你编译的是32/64位,编译java代码都没关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM