The Java Software Platform : A Tutorial for Developers
Java technology continues to play a major role in the software industry. This article explains how Java technology has evolved and provides an overview of the Java software platform.
It describes the Java virtual machine, object-oriented programming with the Java language, and the extensive set of application programming interfaces (APIs) included with the standard Java distribution.
Follow this step-by-step tutorial to learn about the most important components of the Java software platform and why they exist in their current configuration, along with best practices and common pitfalls to avoid when developing your own Java applications.
Java Platform
Java is a programming language and computing platform. Java is the most popular programming language in use on the World Wide Web and one of the most popular languages used in general.
There are many different versions of Java, each designed to be functionally compatible with its predecessor while not breaking any compatibility with older code written in previous versions.
An application written in Java will work on any system that has a JVM (Java Virtual Machine) installed on it. The JVM is available free of charge from Oracle Corporation and other vendors or included with some hardware and operating system combinations, which can make it difficult to know if you have an installation of the latest version of Java on your computer.
Java Runtime Environment (JRE) is a subset of the Java Platform usually consisting only of just the Java Virtual Machine. JRE may be easier to install than Java SDK, as no development tools are included in the installer package.
Java Language
Java is a general-purpose language that can be used to develop any type of application, from games to business software. Java's popularity comes from its portability, reliability, security, and scalability.
Java platform tutorials are designed with developers in mind and teach them how to create applications using the Java programming language.
These tutorials take an easy-to-follow step-by-step approach. Java language tutorials usually start with basic concepts and build on them one at a time.
There are many types of Java tutorials, including Java code editor tutorials, Java SDK tutorials, and Java framework tutorials.
These give learners different ways to master their skills as a developer.
Java was developed by James Gosling in the 1990s and has become widely popular ever since. It first began as Oak - originally an acronym for Oak Language, which it was called before being renamed Java to avoid trademark issues - while working at Sun Microsystems, which turned it into an open-source project.
The Java language has come a long way since then, gaining new features along the way, but still maintains its roots as one of modern technology's most widely used languages today.
One big reason why Java is such a popular technology is that it can run on multiple platforms without any change or adaptation required by programs written in it.
The Java Compiler
Java is an object-oriented programming language. When a programmer writes code in Java, they write it using a set of keywords and constructs that are provided by the language itself.
The compiler then takes the code written by the programmer and converts it into machine language that can be run on a computer.
This process, called compiling or translating, is where Java gets its name from because java is a type of coffee that translates to the best part.
Compiling is done by running javac with appropriate parameters which are short for Java compiler.
The java compiler's role in this process is to take human-readable source code and convert it into bytecode which can then be executed by a virtual machine (i.e., the JVM).
The compilation starts at the file level and builds upward; consequently, any errors must be corrected before proceeding up through nested methods as opposed to propagating up as compilation proceeds downward.
Once compiled, bytecode files will have a .class extension. Bytecodes cannot be read without the use of the runtime system since they are platform-independent.
Hence, the compiler produces class files in order to allow them to work across multiple platforms.
The Java Virtual Machine (JVM)
Java is an object-oriented programming language that was designed to have a simple, universal syntax.
It was originally intended to be compiled and then executed on the JVM, a virtual machine that would translate bytecode into machine code.
The bytecode is an intermediate representation of the program in which there are no references to specific hardware or operating system features.
This means that any application written in Java can run on any platform with a JVM installed.
For example, if you write your software in Java, it will work with Windows XP or Mac OS X just as easily as Linux. You could even take the same Java code and compile it on different platforms, like Unix and Macintosh.
However, some programmers also want to write their applications using languages like C++ or FORTRAN because they require less typing.
If this is the case, the programmer needs to use an interpreter instead of a compiler. An interpreter reads each line of source code one at a time and converts them into executable instructions before executing them.
The Java Runtime Environment (JRE)
The JRE is the base environment that is required to run Java applications and provides a complete execution environment to run applets. It includes an interpreter, compiler, and a number of libraries such as graphics and sound.
One major benefit is that it can be installed on multiple types of operating systems (Windows, macOS X).
There are three main versions of the JRE:
1) Java Runtime Environment Standard Edition or SE
2) Java Runtime Environment Enterprise Edition or EE
3) Java Runtime Environment Personal Edition or PE.
These all provide support for mobile development and security features. What type you choose depends on your needs, but we recommend starting with SE if you are just getting started with developing apps in java. For programmers who have been coding for a while, EE would be a better choice as it has more advanced features.
If you need to use specific enterprise functions and APIs then you will want to use the EE version. PE is great for developers who only need Java on their computers for testing purposes - no installation necessary!
The Java Development Kit (JDK)
Java is a full software platform, not just a programming language. To create and run Java programs, you need the Java Development Kit (JDK).
This software implements the compiler and runtime that enable you to compile and run your code on any system with the necessary operating systems and hardware.
The JDK includes both a compiler and a virtual machine, so it can translate your program into instructions that are understandable by any machine that has a compatible instruction set architecture (ISA) or instruction set.
For example, if you have a PC that uses x86 chips, the JDK will generate x86-compatible code for your application. If you're running on an ARM-based processor found in many smartphones and tablets, then it will generate ARM-compatible code instead.
If you write Java programs exclusively for personal use or the development of small applications in which only one computer will be running them at once, then the OpenJDK implementation of Java may be sufficient.
However, most developers will want to use Oracle Corporation's implementation of Java SE Runtime Environment (JRE) as their implementation because Oracle provides more robust tools and documentation than other providers who offer free downloads of Open JDK.
JRE Vs JDK
Java is a programming language and computing platform. You can use it to write mobile apps, web apps, desktop apps, and more. If you're just starting out with Java, you'll need to install your computer's Java runtime environment (JRE).
The JRE lets you run programs written in the Java programming language. It also includes a compiler and other tools that help you develop code.
But if you want to compile your code into a program that can be executed outside of the JFRE environment (for example, on another computer), then it's best to use the JDK instead of just the JRE. In this case, you would install both the JDK and JRE on your machine.
In order to have full access to all features of the Java SE development kit, you will need Oracle’s JDK which provides the following components:
Java SE Platform Standard Edition Development Kit – It’s important to understand that there are three different versions of the standard edition available and they each have their own purposes; namely version 6u131 or later has support for GPU-accelerated applications which require OpenCL 1.1 or later or Direct3D 9Ex level hardware capabilities; version 8u191 supports typesafe reflection at runtime with stricter bounds checking requirements, and version 11 release 10 supports restricted execution.
Conclusion
In this tutorial, we have covered the basics of the Java platform and how to create a simple program in that environment. You have learned some of the basic syntaxes in order to be able to write programs that will compile on any machine running a JVM.
You have also learned about object-oriented programming and how it is used to make programs easier to understand and modify. Finally, you should now know enough about the language and its features so you can start developing your own programs using this powerful language. Good luck with your future endeavors!
I hope that my article was beneficial to you. To learn more, click the link here.
Comments
Post a Comment