JVM is the main component of Java architecture and it is the part of the JRE (Java Runtime Enviroment) .
It provides the cross platform functionality to java. This is a software process that converts the compiled Java byte code to machine code. Byte code is an intermediary language between Java source and the host system.
Most programming language like C and Pascal converts the source code into machine code for one specific
type of machine as the machine language vary from system to system .
Mostly compiler produces code for a particular system but Java compiler produce code for a virtual machine .
JVM provides security to java Programs written in Java or the source code translated by Java compiler into byte code and after that the JVM converts the byte code
into machine code for the computer one wants to run. JVM is a part of Java Run Time Environment that is required by every operating system requires a different JRE . The architecture of the JVM is given below . This architecture tell us how the JVM works .
Firstly we write the simple java program(source code) the java compiler converts the source code into the byte code ,
after that JVM reads this bytecode and converts this into the machine code.
JVM provides portability … Implementations of java specification for a variety of CPUs and architectures provides the feature of portability.
Foremost, without the availability of a JRE for a given environment, it is impossible to run Java software.
JVM forms the part of large system i.e. the Java Runtime Environment (JRE).
Each operating system and CPU architecture requires a JRE.
JRE consists of a set of base classes i.e. an implementation of the base Java API as well as a JVM.
The byte code format is same on all platforms as it runs in the same JVM and it is totally independent from the Operating System and the CPU architecture. JVM is java interpreter as it converts the byte code into machine code for the computer one wants to run. JRE consists of a number of classes based on JavaAPI and JVM, and without JRE, it is impossible to run Java, So its portability really made it possible in developing write once and run anywhere software .
JVM-Based Languages Grow In Popularity One of the fascinating trends that the Java world has seen in the last few years is the growth of non-Java languages that use the JVMAfter all,
if you create a new programming language, you will need to write it for a particular platform.
If you want your language to be portable across platforms, you will need to implement versions for each of those platforms.
By contrast, if you implement your language on the JVM, then your language will work on any system with a JVM, which means basically everywhere
a growing number of languages are thus being written for the JVM. The oldest JVM-based language, so far as I know, is Jython, formerly known as JPython.
Jython, as you might guess from its name, is an implementation of the Python language on the JVM.
Jython is compatible with the standard version of Python (sometimes known as “CPython”) through version 2.2,
which means that it is missing some of the newer Python features.
The most recent version was released in October 2007
BUT Sun hired two well-known Jython developers earlier this year, and the language now can run the Django application framework, testifying to its compatibility
Sun similarly sponsors the development of JRuby, a JVM-based version of Ruby.
Whereas Jython is one of only two implementations of Python, JRuby is one of several implementations of the Ruby language.
However, JRuby is widely seen as a particularly important variation,
partly because it has become both faster and highly compatible with the standard C implementation of Ruby.
It is able to run Ruby on Rails, in addition to many other functions. Jython and JRuby are both ports of existing languages to the JVM.
Two languages that are totally new to the JVM are Groovy and Scala.
Both are growing in popularity, the difference is that while Groovy is more of a dynamic, “scripting” language, Scala is a statically typed language
Perhaps the best-known use of Groovy is in the Groovy on Grails project, a Web application framework
(similar to Ruby on Rails) written in Groovy, and hosted on the JVM Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way.
It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive.
Code sizes are typically reduced by a factor of two to three when compared to an equivalent Java application.
Programming in Scala Some Java programmers find Scala a little alien at first but soon enjoy the concise way they can express their ideas as programs.
Less key-strokes to make.(My opinion : it’s not enjoyable for Beginners) these languages just examples of JVM-Based Languages.
Java has clearly succeeded as a popular language. It is now growing in popularity as a platform as well.