To develop our awesome Java applications, we need to install the Java Development Kit (JDK). But what is the JDK?? JDK is a software development environment that is bundled with the necessary tools and libraries to develop and run Java programs. The JDK contains the Java Virtual Machine (JVM) and the Java Runtime Environment (JRE).
There are a lot of implementations of JDK. In this article, we will install the Oracle JDK.
First of all, visit the following link https://www.oracle.com/java/technologies/downloads/ and download the package according to your operating system. Then install the software like any other software.
To verify that JDK is installed successfully or not, open your terminal and type
java --version
then press enter. You will do something like this :
Congratulations! You have successfully installed Java
class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
Congrats! you have successfully run your first Java program.
This article was also published in Hashnode
The above is the detailed content of How to setup and run Java on your machine. For more information, please follow other related articles on the PHP Chinese website!