Hacker News new | ask | show | jobs
by hardwaresofton 420 days ago
Does it have to do with the somewhat complicated licensing?
3 comments

Current licenses for Oracle JDK and GraalVM are essentially the same terms. It's pretty straightforward.

https://www.oracle.com/downloads/licenses/graal-free-license...

So for shops that are already open to using the JDK they're obviously already used to the legalese/implications for companies built on this software.

Everyone else in the world probably does not see this as "straight forward".

So Step 0, be a lawyer.

Oracle has specifically reworked its license to make terms clear after the bad press around the initial release of Oracle JDK 17:

https://blogs.oracle.com/java/post/free-java-license

Any company using Java should be willing to read and understand Oracle's terms, whether they use third party OpenJDK distributions or Oracle's builds.

If you're leaving significant performance gains on the table because you can't read, that's on you.

Just like most FOSS licenses, that in big corps always got through legal.

In the projects where that isn't required, usually we have licence validation tooling on the CI/CD pipeline, that breaks the build if the legal wishes aren't fulfilled.

And Oracle's army of lawyers.
Not really, but one thing that bothers me is how unreproducible GraalVM is. AFAIK every distro that has binaries for it just repacks the binaries released from Oracle, and the last time I searched I couldn't find instructions on how to build from scratch (I was the maintainer of GraalVM in nixpkgs, not anymore because I just got fed-up with it).
Not sure why people always say it's so hard to build GraalVM ... all you need is roughly 2 prerequisites and one build command. The prerequisites are a "Labs JDK" which is essentially a slightly modified OpenJDK with more up to date JVMCI (the JIT interface used by Graal) and the build tool "mx".

Since you want to build completely from source, you start by installing OpenJDK. Then you clone the Labs JDK repo [0] and build it just like how you would build any other OpenJDK. Once you have the Labs JDK, you don't need the OpenJDK anymore, since that's only necessary to build the Labs JDK. If you use a normal OpenJDK instead of Labs JDK for Graal, the Graal build will most likely tell you something about "too old JVMCI" and fail. Don't do that.

Next you clone mx [1] and graal [2] into some folder and add the mx folder to PATH. You also need Python and Ninja installed, and maybe something else which I can't remember anymore (but you'd quickly figure it out if the build fails). Once you have that, you go to graal/vm and run the relevant "mx build" command. You specify the path to the Labs JDK via the "--java-home" CLI option and you have to decide which components to include by adding them to the build command line. I can't remember what exactly happens with just "mx build" but chances are this only gives you a bare GraalVM without anything else, which means also no SubstrateVM ("native-image"). By adding projects on the command line, you can include whatever languages/features are available. And that's it. After some time (depending on how beefy your computer is), you get the final GraalVM distribution in some folder, with a nice symlink to find it.

It's not exactly documented in a good way, but you can figure it out from the CI scripts which are in the git repos of Graal and Labs JDK. The "mx build" command is where you decide which languages and features to include; if you want to include languages from external repositories, you have to clone them next to the graal and mx folder and add the relevant projects to the mx build command.

[0] https://github.com/graalvm/labs-openjdk

[1] https://github.com/graalvm/mx

[2] https://github.com/oracle/graal

I think the fact that you had to write a 4 paragraph about the process say more about it than anything.