Wiki - Upgrading Java

Compatibility

Objective

Learn the recommended way to install, remove, or upgrade Java

Background

Oracle drastically changed their licensing model and has stopped providing public updates for Java. The last free Oracle Java update was January 2019.

Because of this change, we have switched all development and testing to AdoptOpenJDK.

Requirements

Steps

  1. Windows
  2. macOS
  3. Linux

Windows

  1. Make sure QZ Tray and other Java dependent software are closed

    • The easiest way to close QZ Tray is to go to the System Tray > QZ Tray > Exit
    • Check Windows Task Manager for other Java program. Look for java.exe or javaw.exe in the process name/details.
  2. Optional: Uninstall all Java versions

    • If you do not require a specific version of Java for another program, it is highly recommended to uninstall all versions currently installed prior to updating
    • To uninstall, go to Control Panel > Programs > Programs and Features
  3. Download AdoptOpenJDK 11 64-bit (HotSpot JVM) from adoptopenjdk.net

  4. Run the installer (e.g. OpenJDK11U-jre_x64_windows_hotspot_11.0.3_7.msi)

    • When asked to select features, take defaults
  5. Verify the Java version

    • Open a cmd prompt and type java -version

      image

  6. Launch QZ Tray

    • If no shortcut has been created, C:\ProgramData\Microsoft\Windows\Start Menu\Programs\QZ Tray

macOS

  1. Make sure QZ Tray and other Java dependent software are closed

    • The easiest way to close QZ Tray is to go to the System Tray > QZ Tray > Exit
  2. Optional: Uninstall all Java versions

    • If you do not require a specific version of Java for another program, it is highly recommended to uninstall all versions currently installed prior to updating

    • Open a terminal (found in Applications > Utilities) and type the following commands:

      sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin \
      sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefpane \
      sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist \
      sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper \
      sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist \
      sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist
      
      # Change for jdk version
      # AdoptOpenJDK is found in /Library/Java/JavaVirtualMachines/adoptopenjdk
      sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
  3. Download AdoptOpenJDK 11 64-bit (HotSpot JVM) from adoptopenjdk.net

    Note: If the JDK version is installed, that must be upgraded as well, as QZ Tray defaults to the JDK version.

  4. Run the installer and follow the prompts on the screen

    • The download will look similar to OpenJDK11U-jdk_x64_mac_hotspot_11.0.3_7.pkg
  5. Verify the Java version

    • Open up a terminal and type java -version. This will first return the JDK version on the system. If JDK is not installed, it will return the JRE version. Whatever version is displayed from this command is the version of Java that QZ Tray will use. image
  6. Launch QZ Tray

Linux

AdoptOpenJDK has a PPA for Debian, Rhel, and OpenSUSE flavors of Linux. Below are instructions for Ubuntu. AdoptOpenJDK's documentation for other flavors can be found here.

Alternatively, you may download and install AdoptOpenJDK11 directly from AdoptOpenJDK.net

  1. Make sure QZ Tray and other Java dependent software are closed

    • The easiest way to close QZ Tray is to go to the System Tray > QZ Tray > Exit
  2. Add AdoptOpenJDK's PPA and install AdoptOpenJDK11

    # Import AdoptOpenJDK's GPG Key
    wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
    
    # Add the PPA
    sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
    
    # Update the package manager
    sudo apt-get update
    
    # Install AdoptOpenJDK11
    sudo apt-get install adoptopenjdk-11-hotspot
    
  3. Verify Java Version

    java -version

    If the wrong version of Java is displayed, you can use this command to switch

    sudo update-alternatives --config java
    

    image

  4. Launch QZ Tray

    If there is no desktop shortcut:

    • Search for "QZ Tray"
    • Go to usr/share/applications and find QZ Tray
Edit this page