I would like to share a couple of thoughts on the Java Runtime Environment (JRE).
People who have tried running Java Server Pages on a web server running in a Java Runtime Environment would have seen an issue while starting the server: “JAVA_HOME is pointing to the Java Runtime Environment and not to the Java Development Kit”.
We know that to run java applications, we need a Java Virtual Machine and we already have one by installing the Java Runtime Environment. But then why is the server complaining that Java Runtime Environment alone is not sufficient?
Though java applications run equally well on systems those have a Java Development Kit or a Java Runtime Environment than what is the difference between the two? Should I use a Java Runtime Environment or a Java Development Kit for my java applications? To answer these questions let us understand “What are the Java Runtime Environment and the Java Development Kit composed of?”
The Java Runtime Environment contains these main components:
Java Virtual Machine Standard java packages
The Java Development Kit has a java compiler in addition to the Java Virtual Machine and the standard packages (i.e. Java Virtual Machine + standard packages + java compiler). A Java Runtime Environment is sufficient just to run java applications, but to develop a java application you will need a Java Development Kit because only the Java Development Kit has the java compiler required to compile the application that you are developing.
Coming back to the earlier Java Server Page issue, Java Server Pages are compiled by the server at runtime and hence requires a java compiler and thus the need for a Java Development Kit.
I hope I have provided clarity about java runtime environment.
Infact, it is showing the advancement of java development kit over java runtime environment. this is very useful for all the java developers.