[graalvm-users] Native Compilation for Macos and Windows

Thu Jan 23 05:42:04 PST 2020

Hi Mike, 

you'll need to utilise the GraalVM native image functionality -- https://www.graalvm.org/docs/reference-manual/native-image/ <https://www.graalvm.org/docs/reference-manual/native-image/> 

In a nutshell, you can feed you jar files to the native-image utility from a GraalVM distribution and it'll analyse the classes in it and compile them to the platform binary. It won't be the .app for MacOS as far as I understand, but it's an executable file that doesn't depend on the JVM, so you can wrap it into the app easily. 
Windows support is experimental --  but you can try, I've seen people being able to build native images of apps for Windows. 

What kind of application do you have? GUI? JavaFX by any chance? If javaFX you should look into GluonHQ -- https://gluonhq.com/gluon-substrate-and-graalvm-native-image-with-javafx-support/ <https://gluonhq.com/gluon-substrate-and-graalvm-native-image-with-javafx-support/>  which uses GraalVM native images but provides necessary config and everything for the JavaFX. 

There might be necessary to provide some configuration to the native image utility, one of the best ways to do so is to run your application with the assisted configuration javaagent so it can record the config for you: https://www.graalvm.org/docs/reference-manual/languages/Native-Image/developer/CONFIGURE <https://www.graalvm.org/docs/reference-manual/languages/Native-Image/developer/CONFIGURE>

If you have questions, I'd be happy to help! 

> On 23 Jan 2020, at 15:15, IT Admin <itadmin at icd.binghamton.edu> wrote:
> Hi, I’m a beginner with Graalvm and I would like to use it to compile a project to a native for MacOS and Windows10.  Currently we take our project’s jars and supporting jars and package them into an installer that creates a launcher on the user’s machine.  This all requires a jdk to be installed on the user’s machine.
> I’m hoping someone can point me in the right direction of how to utilize GraalVM to compile these jars into a native executable (a .app for MacOS and a .exe for Windows).
> I’m just having a little trouble understanding the workflow of doing such a compilation.
> Thank you
> Mike
> _______________________________________________
> GraalVM-Users mailing list
> GraalVM-Users at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/graalvm-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20200123/6786067e/attachment.html 

More information about the GraalVM-Users mailing list