java 将java编译为本机代码?

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

Compiling java into native code?

javacompiler-constructionnative

提问by kzolp67

I'm trying to find a java compiler that I can use to compile my java code into native binaries on different operating systems. I have heard of the GNU Compiler for Java but I can't seem to find a download for that and I think it's dead anyway. Are there any good up-to-date compilers out there that I can use to compile java code into a .exe and a .app or anything or can you tell me how to get the GNU Compiler for Java.

我试图找到一个 java 编译器,我可以用它来将我的 java 代码编译成不同操作系统上的本机二进制文件。我听说过用于 Java 的 GNU 编译器,但我似乎无法找到它的下载,而且我认为它无论如何都已经死了。是否有任何好的最新编译器可以用来将 java 代码编译成 .exe 和 .app 或任何东西,或者你能告诉我如何获得 GNU 编译器 for Java。

回答by zhuwenger

GNU Compiler for the Java can be found at http://gcc.gnu.org/install/binaries.html

用于 Java 的 GNU 编译器可以在http://gcc.gnu.org/install/binaries.html找到

And you may try the following tools:

您可以尝试以下工具:

回答by axle_h

gcjis a part of gcc.

gcj是 gcc 的一部分。

Although judging by it's support for "some 1.5 additions" it is out of date. Why are you bothering though? You can setup an installer that updates the jre instead.

尽管从它对“一些 1.5 个附加项”的支持来看,它已经过时了。你为什么要打扰?您可以设置一个安装程序来更新 jre。