mtitek
  • Cloud
  • Big Data
  • CI
  • Install
  • Samples
  • Java
  • Ubuntu
  • Maven
  • Archive
Java | Install Java (Ubuntu)
  1. References
  2. Install Java
  3. Manage multiple Java versions (update-alternatives)
    1. Check defaults
    2. Add a new java alternative to the system
    3. Configure java alternatives
    4. Set JAVA_HOME

  1. References
    See these pages for more details on how to install Java:
    https://help.ubuntu.com/community/Java
    http://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html
  2. Install Java
    Download the JDK/JRE: http://www.oracle.com/technetwork/java/javase/downloads/index.html

    Extract the file "jdk-8u111-linux-x64.tar.gz" in the folder you want to install Java: /opt/jdk1.8.0_111

    Change the folder permissions:

    Setup the environment variables JAVA_HOME and PATH:
    • Open the file ".profile":
    • Append the following lines:
    • Reload the file ".profile":
    • Verify the environment variables:
    Locate the default java program file:
    Note that on macOS you might get an error similar to this one when you launch java commands:
    "jdk-13.0.1.jdk cannot be opened because the developer cannot be verified ..."
    To fix this issue run the following command on the jdk package before extracting it:
  3. Manage multiple Java versions (update-alternatives)
    1. Check defaults
      Note that these folders may not exist yet in your computer!


    2. Add a new java alternative to the system

    3. Configure java alternatives
    4. Set JAVA_HOME
© 2020  mtitek