Hacker News new | ask | show | jobs
by paulddraper 253 days ago
Compiling Java AOT doesn’t obviate the need for the JVM.

At least not for Graal.

https://stackoverflow.com/questions/75316542/why-do-i-need-j...

2 comments

Because it is user problem, instead of compiling with native image, they produced a shared library out of the Jar.

As you can see, it has nothing to do with that Stack Overflow question,

https://www.graalvm.org/jdk25/reference-manual/native-image/

... That post you linked was from two years ago, discussing JEP 295, which was delivered eight years ago. Graal-based AOT has evolved a lot ever since. And the answer even explicitly recommended using native images:

> I think what you actually want to do, is to compile a native image of your program. This would include all the implications like garbage collection from the JVM into the executable.

And it is this "native image" that all the comments above in this thread have been discussing, not JEP 295. (And Graal-based AOT in native images does remove the need to bundle a whole JRE.)