Java Installation

Install JDK

A Java Development Kit (JDK) is a program development environment for writing java applications. It consists of a Java Runtime Environment (JRE) as well as the tools and programming that developers need to write, compile, debug, and run applications written in the Java language like JSpringBot library that we will be using.

1 Download and install JDK 1.8. You may need to create an oracle account to register the product and complete jdk installation.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2 Set Java in Path

We setup PATH environment variable so we can conveniently run various executable from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as: C:\Program Files\Java\jdk1.8.0_102\javac MyClass.java

For Windows:

Launch System Properties for setting up JAVA_HOME

Open Explorer > Right Click Computer > Properties > Advanced system settings > Environment Variables > System variables > New

Variable Name: JAVA_HOME
Variable Value:  ex. C:\Program Files\Java\jdk1.8.0_102

Note: The variable value depends on where you extracted the jdk. The above is as on my system.

Update Windows Path

Open Explorer -> Right Click Computer -> Properties -> Advanced -> Environment Variables -> System Variables
Select "Path" and then Click "Edit". Then Add ";%JAVA_HOME%\bin" at the end and  then click "OK".

Ensure java is installed. Open a NEW command prompt and run java -version command.

For Mac:

Open ~/.bash_profile and set JAVA_HOME in PATH

JAVA_HOME=/usr/java/jdk1.8.0_102
export JAVA_HOME

PATH=$PATH:$HOME/.local/bin:$HOME/bin:$JAVA_HOME/bin
export PATH

Ensure java is installed. Open a NEW terminal and run java -version command.

Comments

comments powered by Disqus