Comment

Comment by srgseg

I notice that the OpenJDK build is only available as a .tar.gz and not as .rpm

This means that to upgrade from Oracle JDK10 -> Open JDK11, you'll have to write a script yourself to modify the symlinks e.g. to redirect the existing "/etc/alternatives/java -> /usr/java/jdk-10.0.x/bin/java" to the new installation. There are 46 of these symlinks that need changing (for javac, jstack, etc etc).

I hope that's the only change that is required and that I'm not missing something. Anyone know if there is anything else necessary?

Edit: here is the script I just wrote to print out the commands required to change the symlinks:

  #!/bin/bash

  existingJdkBinPath=$(dirname `readlink /etc/alternatives/java`)
  newJdkPath="/opt/jdk-11"

  find /etc/alternatives -type l | while read link; do
    target=$(readlink "$link")
    targetPath=$(dirname $target)
    targetFile=$(basename $target)

    if [[ $targetPath = $existingJdkBinPath ]]; then
      newTarget="$newJdkPath/bin/$targetFile"
      echo ln -snf "$newTarget" "$link"
    fi
  done
parent srgseg 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton