The Java platform - the Java Virtual Machine, how and why it is used

The Java platform - what is the Java Virtual Machine and how and why it is used

JAVA it is an open object-oriented programming language, it was created to overcome the difficulties associated with writing and compiling software for various operating systems and various devices.

Java is translated as "coffee". Why did they call this serious programming language as a tonic drink? Yes, it is simply, because the programmers were very fond of coffee!

The goal of the developers was to create a tool that allows to write code that is completely portable (cross-platform) and at the same time very efficient, stable and executed quickly.

Cross-platform was achieved by creating a virtual Java machine. In the virtual machine environment, Java program code is executed.

Java Virtual Machine or JVM is a program that becomes a layer between the operating system and the Java applications. Versions of JVM for all existing OS are implemented.

Other achievements of developers

  • Developers have achieved a significant reduction in the time while creating complex programs, thanks to a readable and understandable code, whose syntax is similar to C/C++.
  • They have prevented unauthorized execution of malicious code due to security system.
  • They have got an elegant solution to such complex tasks as multi-threading, networking, creating distributed applications, working with data streams, preventing memory leaks, intercepting and handling errors and exceptions.
  • The technology of applets was developed - it is a possibility for dynamically loaded programs to work in a web browser environment, that allows you to create interactive web pages.
  • The technology named WEB-start is developed, it provides the possibility to run the program online, by clicking on the link on the web page. The program is downloaded, cached and launched, no process of installing and updating such software is required, and in this way cross-platform compatibility is also achieved.
  • And finally, JavaFX platform was developed, it based on Java and is used for quickly create amazing applications with a rich user interface. It also is used to run and develop RIA - Rich Internet Applications, to create software for working with multimedia, and provides the ability to program in the JavaFX Script language.

The division of the platform into three main components

  • Java Standard Edition (Java SE) - it provides JVM and a set of libraries for creating desktop applications, both console and windowed with advanced user interface.
  • Java Enterprise Edition (Java EE) it is an add-on for Java SE, it provides a set of libraries for server side programming and creating web applications, from ordinary sites, to complex corporate web applications.
  • Java Micro Edition (Java ME) is a variant of a virtual machine optimized for portable devices, such as hand-held computers and mobile phones.

Currently, the Java EE platform is the best foundation for building enterprise applications.

What does the Java platform installation offer for us?

  • Java Runtime (JRE) - it is the environment provided by the virtual machine.
  • Tools for development - a compiler, a debugger, a tool for creating documentation.
  • API - Application Programming Interface, an extensive set of ready-made libraries for solving typical and non typical tasks.

How do Java programs work?

The programmer creates a file with the extension .java and places into it the source code of the program.

With the help of the compiler, based on the source code, a file with the .class extension is created. Into this file the compiler places the byte code of the program - it is a set of commands for the virtual machine.

When the program is started, a file with byte code is loaded and executed.

Currently, with Java language is written a huge amount of high-quality and useful software, so, in order to not lose all the benefits of using these applications and to have fun creating Java programs, we will start installing the Java virtual machine.