Java platform – what is it

Question:

There is a Java language. It's just syntax.

There is a language implementation – a compiler that understands the syntax of the language and translates it into bytecode.

There is a Java Virtual Machine – it is an interpreter that executes byte-code. As far as I understand, java is therefore cross-platform, because each operating system creates its own JVM that can translate the bytecode for a given OS.

There is a Java Development Kit, which consists of: a java compiler, JVM, and standard Java classes and libraries used in development. The JDK is for the developer.

There is Java Runtime Environment – this is the Java runtime environment.

  • What does Java platform mean?
  • How can other languages ​​like Scala run on the Java platform? Aren't other languages ​​compiled into machine code that the operating system must execute?
  • What does "Java Runtime Environment" JRE mean? Is this what we call the Java Virtual Machine? If JVM and JRE are not the same thing, what are the differences?

Answer:

  1. The Java platform is a collection of what you've described. This is a rather abstract term and in different contexts it can be interpreted in different ways. Sometimes just JRE, sometimes all together even with Java EE Application Server
  2. Other languages ​​on the Java platform can execute in many ways. As you rightly pointed out, the Java virtual machine executes bytecode. Thus, any language whose compiler can generate valid bytecode can be executed in the Java virtual machine. As far as I know specifically in the case of Scala, everything is a little simpler and the mechanism of generalization (generics) and the property of their erasure at runtime are used.
  3. In my understanding, in terms of the Java language – JRE is an interface, and JVM is an implementation. JVM is a bit wider, because may include some cryptographic features, optimizations, compilation into native code, etc., which are not directly required for the execution of the code and its performance, but greatly increase the efficiency of the program.
Scroll to Top