The purpose of this section is to guide you to install Java in your development environment. JDK is a shortcut for Java™ Platform, Standard Edition Development Kit
The JDK is a development environment for building applications, applets, and components using the Java programming language.
Latest version of JDK is JDK 8.
Java SE Development Kit (JDK) for Mac OS X 12.0.2 freeware download - The basic resources you need in order to create apps in Java - Freeware downloads - best freeware - Best Freeware Download.
JDK 8 installation is mandatory if you want to target Android devices.
Navigate to the following URL :http://www.oracle.com/technetwork/java/javase/downloads/
Locate the button Java SE Downloads:
Click on this button.
On the next page select the latest release for the Mac OS X platform: jdk-8u112-macosx-x64.dmg.
Install the package.
Open the Terminal app and type the following command:
To check the JAVA_HOME is correctly setup type the following commands:
You should see the following result:
The JAVA_HOME system variable must be persisted when you leave and resstart a new Terminal Window.
One way to do this is to create or update a .profile file in the user's home directory. This file should contain all the commands that should be executed before the Terminal Window session starts.
Open the Terminal app and type the following commands:
In the Text Editor, type the following line
export JAVA_HOME=$(/usr/libexec/java_home)
You should have a screen similar to the following screenshot:
To save the .profile file, type CTRL + X
, then type Y
followed by the ENTER
key.
Once done, quit the Terminal window, reopen a new one and type the following command to check if the system variable has been persisted:
You should have a non empty response.