Saturday, December 22, 2012

Installing Open JDK 1.6 on Ubuntu


I was really confused while installing Java on my linux machine

Just to clarify they difference between JDK and JRE

What is JRE?
The Java virtual machine is used to compile the Java program which converts source code to byte code (a readable form of machine language). This byte code varies from one platform to platform.

Here JRE is used as a interpreter of byte code into machine code. So JRE is a interpreter for the Java program.
Now we can see what JDK is
JDK contains software development tools which are used to compile and run the Java program.
Both JDK and JRE contains the JVM.
JRE contains the runtime environment such as JVM and other Java classes (AWT, SWING), but does not contain any development tools such as a compiler or a debugger.
In a previous article, Mr Akshaya Bhatia, wrote about the basic tools of JDK. Please refer to this article since it has more details which are not included here.
Summary
The Java Virtual Machine's (JVM) function is to load the appropriate class files for executing a Java Program, and then to execute it.
The Java Runtime Environment (JRE) includes the JVM, as the JRE provides some standard libraries and the JVM which can be used to execute a Java program.
The Java Developers Kit (JDK) also includes the JVM, standard class libraries, and several other tools that a developer needs in order to create a Java program.


You can use the following commands to install it on Ubuntu:
sudo apt-get install openjdk-6-jre
sudo apt-get install openjdk-6-jdk

No comments: