Running/Interpreting C on top of the JVM?

前端 未结 5 462
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 01:52

Is there a way to run plain c code on top of the JVM?
Not connect via JNI, running, like you can run ruby code via JRuby, or javascript via Rhino.

If there is no

5条回答
  •  失恋的感觉
    2020-12-14 02:15

    There are two other possibilities, both open-source:

    JPC emulates an entire x86 pc within the JVM, and is capable of running both DOS and Linux.

    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.

提交回复
热议问题