Java Platform offers JRE and JDK to run Java programs. JRE stands for Java runtime environment and JDK stands for Java development kit. JRE is meant for normal users, who wants to run Java program in their computer. JRE is normally used to run Java programs downloaded over internet e.g. Java Applets and Java Desktop application built using AWT and Swing. The main difference between JRE and JDK, comes from the fact that they are different tools. JDK is created for Java programmers and contains tools required for Java programming, like javac for compiling Java source files to .class files. Without JDK, you can not create Java applications and programs.
By the way, JDK comes with its own JRE, but when you run Java program using java command, the JRE which comes first in System PATH is used for execution.
One of the important thing to know is that, you can not run Java program from your machine if you don't have either JRE or JDK. You can also consider JDK as super set, which also contains JRE.
For a normal user, installing JDK is overkill. They needs JRE only and any browser will assist them for installing JRE, as browser plugin.
By the way, beware with any security issue, while installing JRE. JRE releases sometimes has security flaws which can compromise your computer, that's the reason recently many browser has by default disabled Java.
Any way, in next section we will see some more difference between JRE and JDK in Java.
One of the important thing to know is that, you can not run Java program from your machine if you don't have either JRE or JDK. You can also consider JDK as super set, which also contains JRE.
For a normal user, installing JDK is overkill. They needs JRE only and any browser will assist them for installing JRE, as browser plugin.
By the way, beware with any security issue, while installing JRE. JRE releases sometimes has security flaws which can compromise your computer, that's the reason recently many browser has by default disabled Java.
Any way, in next section we will see some more difference between JRE and JDK in Java.
Difference between JRE vs JDK in Java
In last post, we have seen Difference between JVM and JIT in Java and Now we will compare JDK and JRE. Here are some points, which is useful to differentiate JRE from JDK. Remember JRE, meant for Java Runtime Environment and JDK stands for Java Development Kit. If you go by there name, You can easily see what is difference in JDK and JRE.
1) Main difference between JRE and JDK is that, you can not compile Java program using JRE. Tools required for compiling Java source file to create class files, i.e. javac, comes with JDK installation.
2) As the name suggests JRE is for running Java program and developed as browser plugin. In order to run any Java program from browser like Internet Explore, Mozilla Firefox or Google Chrome, you need JRE to be installed in your machine and should be enable on your browser as well.
3) JRE is meant for users, while JDK is meant for programmers. Since Java was a sensation during the Internet boom of the 1990s, where Applet was most popular for its rich offering over the internet, JRE was required to run those applets on users machines.
That's all on the difference between JRE and JDK in the Java platform. As I said, only JRE is enough to run a Java program and JDK is required only if you want to do programming in the Java platform. For normal internet users, JRE is enough, but beware of security holes comes now and then with different Java releases.
Related Java article from Java67 Blog
- Difference between TreeSet and TreeMap in Java
- How to sort Object in Java using Comparator
- Difference between ArrayList and LinkedList in Java
- How to find Armstrong number in Java
- 10 Java Coding Problems from Beginners
- 40 Java OOP Interview Questions with Answers
- 50+ Java 8 Stream and Functional Programming questions
Thanks, for reading this article so far. If you found this article useful then please share it with your friends and colleagues. If you have any questions or feedback please drop a note.
It is not about which is better, as each offers different benefits for the developer. The JRE will help in running downloaded Java programs on desktop computers. It will accept the same byte code and convert it to machine code and make it compatible for operating systems like Win 32, Win 64, Linux and Android. On the other hand, JDK offers useful tools to develop Java applications.
ReplyDeleteJava is a very easy to use language once u get a hold of it.... if anyone is a beginner in java then they should attend some interesting java focused conferences which gives a huge knowledge abt the language nd very interesting, easy tips nd tricks which are very useful... few of the famous java conferences are Javapolis (devox), JavaOne, and recently i received a mail from oracle regarding their JavaOne conference.. They have many interesting sessions lined up fr this year... you can take a look at their sessions related topics
ReplyDeletehttps://www.regpulse.com/javaone2013/register.php?pcode=737266&src=4003&Act=1
I myself hoping to attend several sessions about Core Java Platform; JavaFX, Java Embedded, and Java Card and many more.