编译器在运行时之前将Java字节码翻译为平台无关的C代码? [英] Compiler to translate Java bytecode to platform-independent C code before runtime?

查看:119
本文介绍了编译器在运行时之前将Java字节码翻译为平台无关的C代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个编译器在运行时之前将Java字节码翻译成与平台无关的C代码(Ahead-of-Time编译)。

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

我应该能够使用标准的C编译器将C代码编译成目标平台的可执行文件。我理解这种方法只适用于很少修改的某些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翻译器。如果你需要转换字节码,那么你可以通过一些工具(例如JadRetro + Jad)反编译类文件,并将源文件传递给JCGO。该工具立即翻译您的java程序的所有类,并生成C文件(每个类一个.c和.h),可以进一步编译(通过第三方工具)到高度优化的本地代码目标平台。尚不支持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字节码翻译为平台无关的C代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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