Is there a native Java AOT for Mac OSX?

I wonder if AOT has compiler (s) for Mac to compile Java applications into native executables, therefore eliminating the need for a JRE?

I saw commercial examples for both Windows and Linux, but could not find anything for Mac other than open source GCSC, which had limited success with some of the poplar java libraries.

A built-in executable for Mac will save it from the JRE and possibly allow it to be signed, allowing Java applications to possibly be hosted in the application store.

+4
source share
2 answers

Install4J can compile your Java into a native OS X application, but the system still needs to have a JRE. Install4J simply creates a wrapper to invoke the JRE.

0
source

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.

0
source

All Articles