Login  Register

GraalVM 24 + Jogl 2.5.0

classic Classic list List threaded Threaded
9 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

GraalVM 24 + Jogl 2.5.0

Andre
39 posts
Has anyone figured out how to use GraalVM and JOGL, along with other libraries, correctly? There is hardly any precedent for both together when searched for. Even "the bot" gave up. :)
.
I am a Robot
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

gouessej
Administrator
6045 posts
Hello

Why do you need to use JOGL with GraalVM? Some constraints might be problematic for JogAmp.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

Andre
39 posts
My primary goal is to create an executable and evaluate its performance. Currently, Launch4j is my preferred tool, but I'm always exploring new possibilities. Recently, I attempted to use Jogl with GraalVM, but I couldn't get it to work What are the constraints?
I am a Robot
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

gouessej
Administrator
6045 posts
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

Andre
39 posts
This post was updated on Apr 11, 2025; 4:05pm.
Thanks for the read. Normal start in IDE works fine. Just creating a jar to exe is kinda complicated.
I am a Robot
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

kit89
3 posts
Hi,

I did some work on this to get a personal project working, before you can build the executable with native-image, you need to create a reachability-metadata config using the tracing-agent running via normal java.

https://www.graalvm.org/latest/reference-manual/native-image/guides/configure-with-tracing-agent/

I ran into problems with java.awt.Font on GraalVM 24, I think I downgraded to an older version of GraalVM and got it working, but don't quote me on that.

I've recently replaced the use of java.awt.Font with jogamps font classes, grabbing the triangulated glyphs and rendering them that way. I've not rested GraalVM 24 to see if that resolves my problem.

Hope this helps.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

gouessej
Administrator
6045 posts
Thank you for the feedback. What was the exact symptom?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

kit89
3 posts
From a JOGL perspective I don't think there was any unexpected issues, the tracing agent is required for anything that loads native libraries. As for the java.awt.Font it was making use of a system-property that wasn't set by GraalVM.

I'll have to rerun my experiments to highlight any specific jogl problems, but off the top of my head I don't think there was any.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: GraalVM 24 + Jogl 2.5.0

kit89
3 posts
I reran the procedure to see if I had forgotten anything.

I found this article to be the most effective at getting something working with the fewest hoops:

https://www.praj.in/posts/2021/compiling-swing-apps-ahead-of-time/

It should be noted that the 'native-image' and 'java' referenced in the above article come from your graalvm installation. If you don't use the grallvm 'java' the tracing-agent wont be found.

You'll need to extract all the native libraries used by your jogamp dependencies and place them in the same directory as the executable that was created when you ran 'native-image'.

Overall it worked rather nicely.