Hacker News new | ask | show | jobs
by johnydepp 3553 days ago
That's great! Won't it make the compiled executable platform specific?
5 comments

You're intended to use it like this: either you distribute JARs and the recipient triggers the AOT compilation if they want it, or you distribute a "jlinked" JRE image that's inherently OS specific because it includes a bundled JVM. It's also possible that a future Java module format will allow the AOT compiled code images to come along for the ride next to the classfiles.
There are other JVMs that already do AOT compilation. This just brings an AOT compilation option to Java. It also looks like the contained file will include both the compiled version and the normal bytecode, so that the code can be recompiled if/when necessary.
I believe that's the whole point.

From what I could gather, this is the process one would follow to get native code:

.java -> javac -> .class (still cross-platform bytecode) -> jaotc -> .so native code

the generated .so file will be platform specific, but it seems like the class files will still be needed as usual
Write once, run anywhere... you've compiled it to.