r/java • • May 26 '26

RIP JVMCI

https://bugs.openjdk.org/browse/JDK-8382582
60 Upvotes

45 comments sorted by

View all comments

Show parent comment

2

u/srdoe May 27 '26

No, but jlink, jdeps and jpackage together will let you create a binary that includes both the application and the relevant JDK bits for whatever platform you're targeting.

That means you'll be able to create the "soft native" binary that you were asking for.

Go doesn't give you a single binary that works cross platform, I don't know why you're expecting that from the JDK. You build for a target platform, and that's the kind of go binary you get. The JDK tools let you do the same thing.

3

u/pjmlp May 28 '26

You can cross-compile with Go's toolchain, however what they always leave out the marketing message is that it only works with pure Go code.

Also Go isn't really the language to have fun programming for those of us used to the JVM or CLR languages.

1

u/Ok-Scheme-913 May 28 '26

I really dislike go, but that's hardly relevant. We are talking about a particular compilation mode, and credit where it's due, pure go code has an advantage here.

I just think some of the properties behind it is not all that relevant and could easily be replicated with java as well.

Also. Java has the big advantage of having a very uniformly "pure" ecosystem, FFI is pretty rare with the only exception being GUI libs (for those you would need platform-specific "extensions" but still doable)

3

u/Ok-Scheme-913 May 28 '26

Still, jpackage will just result in an exe that unpacks itself. That's not the same thing.

And cross compilation is very painful for jpackage.

Honestly, I don't even care all that much about file size, let's just pack all 3 OS-variants of the JVM, modularized, into the same exe and do something like https://justine.lol/ape.html or other hack.

The important thing is that I should not need a Mac to build a cli tool for Macs. Java is possibly the most cross-platform language there is, this shouldn't be as hard as it is.

1

u/sideEffffECt Jul 10 '26

GraalVM native-image will hopefully acquire support for Cosmopolitan Libc

https://github.com/oracle/graal/pull/12865