Installing The Java Development Kit (JDK)
Windows
- Download the Windows x64 download from Oracle here.
- Run the installer that you just downloaded. Java will install in your "Program Files" folder. (You may also have a "java" folder in "Program Files (x86)" and you should ignore it because the java kit you are currently downloading will NOT install there.)
- Add the path to the bin folder in the java folder that you just installed to your PATH environment variable. Make sure that it is the path to the bin folder and not the path to a file inside the bin folder. eg: C:\Program Files\Java\jdk-10.0.2\bin
- Verify that you have successfully installed java.
NOTE: Make sure that you download the Java Development Kit (JDK) not the Java Runtime Environment (JRE). The JRE only allows you to run java programs, in order to develop your own java programs you will need the JDK.
Mac OS X
- Make sure that you have installed Homebrew before proceeding! Look at the top of the resources page on this website for instructions on installing Homebrew.
- Run the folloing command in the Terminal:
- Verify that you have successfully installed java.
brew update
brew tap caskroom/cask
brew install Caskroom/cask/java
The commands running successfully looks like this:
Linux
- Most distros use the openJDK instead of Oracle's. This can lead to some issues with JavaFx, so make sure you install the Oracle version by running the following commands according to your distribution (if yours isn't listed, you probably have the expertise to install the Oracle version of Java on your own):
-
Ubuntu, Debian, Mint (anything using the APT package manager):
sudo add-apt-repository ppa:linuxuprising/java sudo apt update sudo apt install oracle-java10-installer # If you have other versions of java installed, run the following sudo update-alternatives --config java # Select the option with Oracle java 10 sudo update-alternatives --config javac # Select the option with Oracle java 10
-
Fedora, CentOS (anything using RPM packages):
- Install the rpm package here.
- Run the following:
rpm -ivh /path/to/installed/rpm # May need sudo # Use the following commands to select Oracle Java 10 as the default alternatives --config java alternatives --config javac
-
Ubuntu, Debian, Mint (anything using the APT package manager):
- Add the JDK's bin directory to your PATH environment variable, if necessary (not required if using methods listed above).
- Verify that you have successfully installed java.
All Operating Systems
To confirm that your java installation was successful:
- At the command prompt type java -version. You should get output on the next line like java version 10.0.2.
- At the command prompt type javac -version. You should get output like javac 10.0.2.
- The output should look something like this:
$ java --version java version 10.0.2 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM (build 10.0.2+13, mixed mode) $ javac --version javac 10.0.2
Oracle's installation instructions
Oracle, the company that makes Java, has documentation here