编译器运行之前,Java字节code转换为独立于平台的C code吗? [英] Compiler to translate Java bytecode to platform-independent C code before runtime?

查看:177
本文介绍了编译器运行之前,Java字节code转换为独立于平台的C code吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个编译器运行之前,Java字节code转换为独立于平台的C code(名列前茅的时间编译)。

I'm looking for a compiler to translate Java bytecode to platform-independent C code before runtime (Ahead-of-Time compilation).

我应该再能够使用一个标准的C编译器来编译C code到目标平台的可执行文件。我理解这种方法只适用于不经常修改某些Java应用程序是合适的。

I should then be able to use a standard C compiler to compile the C code into an executable for the target platform. I understand this approach is suitable only for certain Java applications that are modified infrequently.

那么,什么是Java-to-C编译器有哪些?

So what Java-to-C compilers are available?

推荐答案

我可以建议你采用一种 JCGO 工具这是一个Java源代码为C的翻译。如果你需要转换字节code,那么你可以通过一些工具(例如,JadRetro + JAD)反编译的类文件和源文件传递给JCGO。该工具一次转换你的java程序的所有类和生产C文件(一个.C和.h每类),这可能会进一步,将(由第三方工具)编译成高度优化的本地code表示目标平台。 Java泛型尚不支持。 AWT / Swing和SWT的支持。

I could suggest a tool called JCGO which is a Java source to C translator. If you need to convert bytecode then you can decompile the class files by some tool (e.g., JadRetro+Jad) and pass the source files to JCGO. The tool translates all the classes of your java program at once and produces C files (one .c and .h for each class), which could, further, be compiled (by third-party tools) into highly-optimized native code for the target platform. Java generics is not supported yet. AWT/Swing and SWT are supported.

这篇关于编译器运行之前,Java字节code转换为独立于平台的C code吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆