Skip to content

Upgrading Java

Kyle La Barge edited this page May 23, 2019 · 33 revisions

Compatibility

  • ✅ 2.1 |✅ 2.0 | ✅ 1.9 | ...

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.

  • AdoptOpenJDK 11 64-bit with the Hotspot JVM is our recommended version of Java for all platforms.

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 out of QZ Tray is to go to the System Tray > QZ Tray > Exit
    • Check Windows Task Manager for other Java programs
  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, you will need to select the Javasoft (Oracle) registry keys for using any version prior to QZ Tray 2.0.10

      image

  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 out of 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. Test QZ Tray

    • If there is no desktop shortcut, start QZ Tray by going to Applications > QZ Tray
    • Test functionality by visiting our demo page. Note that this page only works with 2.0 or higher.
  7. Launch QZ Tray

  • If there is no desktop shortcut, go to Applications > 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 out of 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
Clone this wiki locally