What is the difference between JRE,JVM and J

系统 1496 0

If you are a Java developer, it is very often that you think about understanding the JRE,JVM and JDK. Once if you understand these things, it would be quite easy for you to visualize things in logical manner. Also look at the picture below, that will clear all your questions about the JRE,JVM and JDK. This article explains about the each term and will make you understand perfectly. Hope this helps. If you are happy to receive our future updates on Java, please subscribe  here .

JDK (Java Development Kit)

Java Developer Kit contains tools needed to develop the Java programs, and  JRE  to run the programs. The tools include compiler (javac.exe), Java application launcher (java.exe), Appletviewer, etc… Compiler converts java code into byte code. Java application launcher opens a  JRE , loads the class, and invokes its main method.

You need  JDK , if at all you want to write your own programs, and to compile the m. For running java programs, JRE is sufficient. JRE is targeted for execution of Java files i.e.  JRE  =  JVM  + Java Packages Classes(like util, math, lang, awt,swing etc)+runtime libraries.  JDK  is mainly targeted for java development. I.e. You can create a Java file (with the help of Java packages), compile a Java file and run a java file.



JRE (Java Runtime Environment)

Java Runtime Environment contains JVM, class libraries, and other supporting files. It does not contain any development tools such as compiler, debugger, etc. Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE. If you want to run any java program, you need to have JRE installed in the system

JVM, JRE and JDK The  Java Virtual Machine  provides a platform-independent way of executing code; programmers can concentrate on writing software, without having to be concerned with how or where it will run.  But, note that JVM itself not a platform independent. It only helps Java to be executed on the platform-independent way. When JVM has to interpret the byte codes to machine language, then it has to use some native or operating system specific language to interact with the system. One has to be very clear on platform independent concept. Even there are many JVMs written on Java, however hey too have little bit of code specific to the operating systems. 

If u just want to run applets (ex: Online Yahoo games or puzzles),  JRE  needs to be installed on the machine.

JVM (Java Virtual Machine)

As we all aware when we compile a  Java file , output is not an ‘exe’ but it’s a ‘.class’ file. ‘.class’ file consists of  Java byte codes  which are understandable by JVM. Java Virtual Machine interprets the byte code into the machine code depending upon the underlying operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking, etc… JVM is platform dependent.

The  JVM  is called “virtual” because it provides a machine interface that does not depend on the underlying operating system and machine hardware architecture. This independence from hardware and operating system is a cornerstone of the write-once run-anywhere value of Java programs.

There are different JVM implementations are there. These may differ in things like performance, reliability, speed, etc. These implementations will differ in those areas where Java specification doesn’t mention how to implement the features, like how the garbage collection process works is JVM dependent, Java spec doesn’t define any specific way to do this.




- See more at: http://www.javabeat.net/what-is-the-difference-between-jrejvm-and-jdk/#sthash.Q8bQwkue.dpuf

What is the difference between JRE,JVM and JDK?


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论