JAVA- JRE/JDK/JVM (Platform Independency)

448
January 28, 2017, at 2:21 PM

Java is a platform independent language. But, JVM is machine dependent. So, my question is: Which parts of java are platform independent? JRE, JDK or JVM? Please Explain.

Answer 1

JVM , JRE , JDK these are all the backbone of java language. Each components work separately . JDK and JRE physically exists but JVM is an abstract machine that means it has not physically exists.

JVM

JVM (Java Virtual Machine) is a software. It is a specification that provides runtime environment in which java bytecode can be executed. It is not physically exists.

JVMs are not same for all hardware and software, for example for windows os JVM is different and for Linux JVM is different. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.

JRE

The Java Runtime Environment (JRE) is part of the Java Development Kit (JDK). It contains set of libraries and tools for developing java application. The Java Runtime Environment provides the minimum requirements for executing a Java application. It physically exists. It contains set of libraries + other files that JVM uses at runtime.

JDK

The Java Development Kit (JDK) is primary components. It physically exists. It is collection of programming tools and JRE, JVM.

Answer 2

All 3 are platform dependent.

  1. JVM -> platform dependent.
  2. JRE -> consists of JVM and some other things. Since it include JVM, it is platform dependent.
  3. JDK -> consists of JRE, compiler and some other things. Since it includes JRE which in turn includes JVM, it is platform dependent.

The java code before and after compilation is platform independant. You can compile on windows and run the byte code on unix using Unix's jvm.

Rent Charter Buses Company
READ ALSO
What data structure should I be using to get rid of [ ]?

What data structure should I be using to get rid of [ ]?

I have a program that uses a TreeMap to store an index

253
Using an If/Else statement in JavaFX

Using an If/Else statement in JavaFX

I am trying to use an if/else statement in my Java FX program but it keeps giving me the "else" output even if the "if" statement is metI checked my onaction events and my fx ids just to make sure they were corresponding

1394
How to override the compareTo method in the rectangle class that compares based on perimeter?

How to override the compareTo method in the rectangle class that compares based on perimeter?

I have a rectangle class here and I need to override the compareTo method so that it compares based on the rectangle's perimetersI know the current compareTo method I have is wrong but I don't know how to fix it

526
Show javadoc of outsourced documentation of current project in javadoc view and content assist

Show javadoc of outsourced documentation of current project in javadoc view and content assist

I outsourced writing of documentation for my current project to a different branch and deleted all docs from my *java files from my actual develop branch

327