I was able to play around with the latest early access binary for Project Loom by downloading the file from http://jdk.java.net/loom/, extracting it (I had a directory called jdk-18
), setting the JAVA_HOME
env var to the jdk-18
directory, and adding the bin
subdirectory for the build to the beginning of my PATH
env var. I was able to use the build to compile and run a Java program using the virtual thread preview features.
But this feels like a very manual process. I like how SDKMAN manages JDKs on my system. How can I set up this early access build (or any other JDK build for that matter) as an entry in the list of JDKs managed by SDKMAN, so that I could change to it, for example, by typing sdk default java <my-jdk-18-name>
?
SDKMAN has a feature called "Install Local Version(s)" (https://sdkman.io/usage#localversion).
So, to set up a custom build of the JDK with SDKMAN, I can download and install the JDK wherever I want and then link it to SDKMAN so that it's useable like any other JDK managed by SDKMAN:
After installing and linking: