Checking for the availability of the JDK.
-
Check if you have the JDK already installed. Go to your command line and type the following command:
javac -version
You will see a message such as the following, if you have the JDK installed:
javac 1.8.0_45
Important: Make sure you use javac when you test if JDK is installed and not java, which tests if JRE is installed.If you get "command not found" you need to install the JDK. Also if you have a version of the JDK prior to 1.8 you will need to install 1.8 or above. It is possible to have multiple versions of the JDK installed (and multiple Java run-times). You will later see how you can configure your JAVA_HOME variable so that Maven uses the correct version of the JDK.
Downloading the JDK.
- Download the JDK from the Oracle JDK site.
Installing the JDK.
- Carefully review the Oracle JDK 8 installation guide as appropriate for your system.
- Install the JDK, following the Oracle instructions.
Verifying the JDK is successfully installed.
-
Go to your command line and type the following command:
javac -version
This will display information such as the following:
javac 1.8.0_45
To be extra sure you should also check your Java run-time by entering the following command:
java -version
This will display information such as the following:
java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Double check that the version of Java installed is correct (1.8).