Skip to content

Installing Java

discorddioxin edited this page Dec 24, 2020 · 9 revisions

Download the Java Development Kit (JDK)

Jump To Instructions For...

OracleJDK vs OpenJDK

  • Both

    • Maintained by Oracle
    • Free to use for personal development
    • Abide by the same specifications (JLS, JVMS)
  • OracleJDK

    • Distributed under OTN License Agreement for Java SE
    • Requires Java SE Subscription for long-term support (LTS)
      • Java 8 receives LTS without subscription until end of 2020
  • OpenJDK

    • Distributed under GPLv2+CPE
    • Support up until a new version is released

See FAQ: https://www.oracle.com/java/technologies/javase/jdk-faqs.html


Downloading OpenJDK

1) Go to: https://jdk.java.net/

2) Choose the Ready for use JDK

3) Download the proper package under Builds

4) Extract the .zip or .tar.gz to obtain folder

5) Remember location of JDK folder.

6) Continue onto Installing OpenJDK.

Installing OpenJDK

For Windows Users

1) Move downloaded JDK folder to the C:\Program Files\Java\ folder

  • If you can't find the JDK folder, look in C:\Users\[Your Account]\Downloads
  • Create the Java folder if needed
  • I recommend creating an OpenJDK folder incase you want OracleJDK as well

2) Open Environmental Variables

  • On your keyboard, press Window + R to open the Run tool
  • Type in SystemPropertiesAdvanced and hit Enter
  • Towards the bottom, click Environmental Variables

3) Under System Variables, search for the Path variable

4) Double click Path to add a new entry

5) Add the following path

  • With OpenJDK folder: C:\Program Files\Java\OpenJDK\[Your JDK Folder]\bin
  • Without OpenJDK folder: C:\Program Files\Java\[Your JDK Folder]\bin
  • Examples
    • With OpenJDK folder
      • C:\Program Files\Java\OpenJDK\jdk-15.0.1\bin
      • C:\Program Files\Java\OpenJDK\jdk-14.0.2\bin
      • etc..
    • Without OpenJDK folder
      • C:\Program Files\Java\jdk-15.0.1\bin
      • C:\Program Files\Java\jdk-14.0.2\bin
      • etc..

6) Move the path to the top with the the ^ button

  • If multiple paths (including OracleJDK) exists, the first one (top-most) will be used
  • Can move different JDK paths to the top to switch which JDK is default

Installing OracleJDK

Using the Installer

1) Go to: https://www.oracle.com/java/technologies/javase-downloads.html

2) Select your desired version

3) Go to the download page for that version

4) Choose the 64 Installer/Package

  • WARNING: Choosing 64 Compressed Archive will require you to perform installation manually.

5) Use the default settings in the installer

6) Continue onto Testing Java Installation


Testing Java Installation

  • Open the terminal/command prompt

  • Use the following command:

    • java -version

If it displayed a version, you've installed Java!

Clone this wiki locally