0

I have recently started learning JAVA. My teacher told me that JVM as name says Virtual basically not exist as physically or as a software(or anything you say). according to him JVM is just a specification document to develop JRE for different platform. JRE is the real Implementation of JVM which does all the work of running Bytecode etc.

I have done some searching myself but not found the same thing anywhere. instead lot of people says that JVM is used to run the Bytecode and JRE provides run time. thats very unsatisfactory.

so i want to know that what is difference bwtween JVM and JRE. if some real documentation from oracle or sun microsystem is there. then provide the link

adhikari
  • 112
  • 2
  • 13
  • @Troubleshooot I am not asking about the difference. I am asking that whether JVM is just a specification document or not – adhikari Jan 19 '14 at 15:41

2 Answers2

5

Learn to search before posting these types of question. Google is really useful in many ways :P

http://www.javabeat.net/what-is-the-difference-between-jrejvm-and-jdk/

JVM The Java Virtual machine (JVM) is the virtual machine that run the Java bytecodes. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed there are specific implementations of the JVM for different systems (Windows, Linux, MacOS, see the wikipedia list..), the aim is that with the same bytecodes they all give the same results.

JDK and JRE

To explain the difference between JDK and JRE, the best is to read the Oracle documentation and consult the diagram :

Java Runtime Environment (JRE) The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.

Java Development Kit (JDK) The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.

What is the difference between JVM, JDK, JRE & OpenJDK?

Community
  • 1
  • 1
Ritz
  • 180
  • 1
  • 12
0

Did you check wikipedia? http://en.wikipedia.org/wiki/Java_virtual_machine @See picture. The Java APIs and JVM together make up the Java Runtime Environment (JRE).

Vadim Kirilchuk
  • 3,532
  • 4
  • 32
  • 49
  • what you say JVM is just Specification document or set of instructions to run .class file format – adhikari Jan 19 '14 at 15:38
  • I would say the JVM itself is a specification (it also includes spec for available set of instructions), and there are several implementations from different vendors, like one from Oracle, and then - "each particular host operating system needs its own implementation of the JVM by Vendor", so even for Oracle JVM they need different implementations for each OS. – Vadim Kirilchuk Jan 19 '14 at 15:44
  • :Yes that's what i also think that JVM is a specification & JRE is the real implementation of JVM. then is it correct to say that JVM runs the bytecode. while we know that it's just a specification so that different vendors would write their version of JRE – adhikari Jan 19 '14 at 15:51
  • "JVM runs the bytecode", JRE runs bytecode (that's why it is runtime environment), specification can't run anything =) However people usually imply JRE when saying "JVM". – Vadim Kirilchuk Jan 19 '14 at 15:53
  • thanks ... that's cleared some doubt. – adhikari Jan 19 '14 at 15:58