Compiling C++ for the JVM(为 JVM 编译 C++)
问题描述
在编译 C++ 时,您当然要为要编译的目标平台使用编译器.是否有针对 JVM 的 C++ 编译器(因此不是使用 Java本机"接口,而是将 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++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为 JVM 编译 C++


基础教程推荐
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 从 python 访问 JVM 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01