Is there a Native Java AOT For Mac OSX?
Asked Answered
A

2

4

I wonder if there is a AOT complier(s) for the Mac to compile Java apps into native executables, therefore eliminating the need for a JRE?

I have seen commercial examples for both Windows and Linux but haven't been able to find anything for the Mac, other than the opensource GCJ which has limited success with some of the poplar java libraries.

A native executable for the Mac would rid it of the JRE and, possibly, allow it to be signed allowing Java developed applications to possibly be accepted into the app store.

Armageddon answered 19/2, 2011 at 14:7 Comment(0)
R
0

Install4J can compile your Java into a native OS X application but the system still should have JRE installed. Install4J just creates a wrapper for a JRE call.

Roe answered 31/8, 2011 at 0:54 Comment(1)
That isn't a true native OS X application, like you said its a wrapper and still requires the JRE. A true AOT will compile the Java code into a true native application so there are no such dependencies.Armageddon
D
0

You can use the Avian JVM for this. (Wikipedia article).

You can compile your application to a standalone executable and it supports different class libraries: openjdk, the Android class library implementation (even if you are not running on Android), and a custom class library that is very limited (basically they add methods to it as the authors need APIs to run their own applications).

In the README in the code repository there is a description how to embed the VM and generate a "boot" C++ program that will run your application and refer to the section "bootimage" if you want to AOT compile all the methods and generate a binary image obviating the need for JIT compilation at runtime.

Without the boot image, you can ship the jar files and a executable that will "start" them (the executable will embed the virtual machine). With the boot image, the jar files will additionally be pre-compiled to native code.

On the other hand, if you just need a managed language/platform, you can also use .NET/Mono AOT. See the mkbundle tool included with Mono 2.x.

Downright answered 30/12, 2013 at 23:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.