You can use the Avian JVM for this. ( Wikipedia article ).
You can compile your application into a standalone executable file and support different class libraries: openjdk, implementation of the Android class library (even if you are not working on Android), and a custom class library, which is very limited (basically they add methods for it, since the authors need APIs to run native applications).
In the README in the code repository there is a description of how to embed a virtual machine and generate a “bootable” C ++ program that will launch the application and refer to the “bootimage” section if you want AOT to compile all methods and generate a binary image, getting rid of the need to compile JIT at runtime.
Without a boot image, you can send jar files and an executable file that will “run” them (the executable will insert the virtual machine). With the boot image, the jar files will additionally be compiled into native code.
On the other hand, if you only need a managed language / platform, you can also use . NET / Mono AOT . See the mkbundle tool included with Mono 2.x.
duncan
source share