Check out example codes for "raspberry stackexchange how to install the java jdk". It will help you in understanding the concepts better.

Code Example 1

sudo apt-get install openjdk-7-jdk

Code Example 2

sudo apt-get install openjdk-7-jre

Learn ReactJs, React Native from akashmittal.com