Friday, January 18, 2019

Updating to OpenJDK 11

Download OpenJDK's JDK 11 from https://jdk.java.net/11/

On Windows (10):
  1. extract zip to Program Files/Java/
  2. change JAVA_HOME environmental variable to point to the new JDK
On Ubuntu (16.04) for version 11.0.2:
  1. unpack tar.gz to /usr/lib/jvm/ (command taken from OpenJDK installation guide)
    sudo tar xvf openjdk-11*_bin.tar.gz --directory /usr/lib/jvm/
  2. update alternatives to be able to switch between other java installations (command taken from DZone guide)
    sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.2/bin/*; do update-alternatives --install /usr/bin/$(basename $bin) $(basename $bin) $bin 100; done'
    sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.2/bin/*; do update-alternatives --set $(basename $bin) $bin; done'
  3. don't forget to update the JAVA_HOME environmental variable if you use maven

No comments:

Post a Comment