32/64 位日食

发布于 2024-09-14 12:35:30 字数 157 浏览 2 评论 0原文

  • 在 64 位 openSUSE Linux 上,使用 32 位 JVM 运行的 32 位 eclipse 可以为 64 位系统编译代码吗?

  • 这个设置可以吗? (在 64 位系统上安装并运行 eclipse/java 32 位)

  • On 64-bit openSUSE Linux, can a 32-bit eclipse running with 32-bit JVM compile code for a 64-bit system?

  • Is this setup possible? (Installing and running eclipse/java 32-bit on a 64-bit system)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

私藏温柔 2024-09-21 12:35:30

如果您正在构建纯 Java,则不存在针对特定体系结构进行编译的情况 - Java 字节码可以跨 CPU 体系结构和 32/64 位移植。

如果你想编译另一种语言(例如 C++),那就有点困难了。同样,如果您尝试在一种架构上为另一种架构构建 JNI 包装器,您可能会发现问题。

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.

If you want to compile another language (such as C++) then it gets a bit harder. Likewise you may find problems if you try to build JNI wrappers for one architecture on another.

人间不值得 2024-09-21 12:35:30

当你用 Java 编译时,没有 32/64 位的概念,它只是 java 字节码。所以是的,你可以在32位环境中编译java并在64位环境中运行它。

When you compile in Java there is no notions of 32/64bits it's just java Bytecode. So yes, you can compile java in a 32bits environment and run it in a 64bits one.

假面具 2024-09-21 12:35:30

编译后的 Java 程序始终是相同的,因为 Java 通过处理架构和本机调用的 Java 虚拟机运行。 Java 程序并没有完全编译为机器代码,仅编译为虚拟机的字节码。这意味着Java程序可以在任何体系结构上运行。

The compiled Java program is always identical as Java runs through the Java virtual machine which handles the architecture and native calls. A Java program is not fully compiled all the way to machine code, only up to bytecode for the virtual machine. This means that a Java program can work on any architecture.

救赎№ 2024-09-21 12:35:30

关键点是您选择运行 Eclipse 的 JVM 和您的最终程序。

如果您的所有代码都是 Java,那么结果可以在任何一个上运行。最明显的区别是程序实际可以使用的内存量,其中 64 位 JVM 比 32 位 JVM 允许使用更多内存。

The crucial point is the JVM you choose to run Eclipse iwth and your final program.

If all your code is Java then the result can run on either. 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.

少女净妖师 2024-09-21 12:35:30

我记得有一些依赖于处理器架构的 XUL 库。

因此,您需要的方法是模拟/虚拟化 eclipse 环境 x86 以在 x64 环境中运行。

所以最预期的异常应该是 XUL 库错误。

另一种生活窍门可能是切换到 x86 eclipse 包中的 x64 库,但这并不能保证。

因此,尝试在您的环境中安装 x86 eclipse 应用程序并在此处发布日志。

问候
尤金

As i remember there are some XUL library which depends of processor architecture.

So the way you need is emulate/virtualize eclipse environment x86 to run inside of x64 environment.

So the most expected exception should be XUL libraries error.

And one another life-hack could be switching to x64 libraries in x86 eclipse package, but its not guaranteed.

So, try to install x86 eclipse application to your environment and post here logs.

Regards
Eugene

锦欢 2024-09-21 12:35:30

检查问题的答案 64 位 JVM 的 Java 编程

当您编译 java 代码,无论您是否编译 32/64 位。

Check answers for question Java programing for 64 bit JVM

It should not matter when you compile java code whether you compile for 32/64 bit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文