编译JVM的C ++ [英] Compiling C++ for the JVM

查看:135
本文介绍了编译JVM的C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当编译C ++时,你当然使用编译器来编译目标平台。是否有一个针对JVM的C ++编译器(因此,不使用Javanative接口,C ++代码被编译为Java字节代码)?

When compiling C++ you of course use a compiler for the target platform you want to compile for. Is there a C++ compiler that targets the JVM (so instead of using the Java "native" interface C++ code is compiled to Java byte code)?

推荐答案


NestedVM 为Java字节码提供二进制转换。这是通过将GCC编译为MIPS二进制文件,然后将其翻译为Java类文件来完成的。因此,用C,C ++,Fortran或GCC支持的任何其他语言编写的应用程序都可以在没有源代码更改的情况下以100%纯Java运行。

NestedVM provides binary translation for Java Bytecode. This is done by having GCC compile to a MIPS binary which is then translated to a Java class file. Hence any application written in C, C++, Fortran, or any other language supported by GCC can be run in 100% pure Java with no source changes.

这篇关于编译JVM的C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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