Java Environment Setup

To write code in Java, you must first have the JDK and Java Development IDE installed on your computer.

JDK

JDK stands for Java Development Kit. JDK is required for writing, compiling and running a Java program. JDK includes:

  • Java Runtime Environment (JRE in short) - Required to run a Java-based application.
  • An interpreter - Helps to interprets compiled Java code.
  • A compiler (javac) - Compiles Java code into bytecode.
  • A documentation generator (Javadoc).
  • An archiver - Helps to create jar file.
  • Other tools - Required in Java application development.

Java Development IDE

Java code can be written in a simple text editor like Notepad. However, software programmers prefer to use IDE (Integrated Development Environment) such as Eclipse, Netbeans, IntelliJ IDEA, etc. The use of Java IDE makes the development of a Java program very easy. An IDE usually has a source code editor, build automation tools, and a debugger. Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or both.

Install JDK and Java Development IDE

Starting with Java 11, Oracle uses a new commercial license for Java. You may need to buy a license from Oracle if you want to use the official JDK in a commercial setting. Otherwise, you should use OpenJDK which is free to use. The difference between the Oracle JDK and OpenJDK is, the Oracle JDK is an optimized version of Java. Whereas, OpenJDK is an open-source and is not optimized.

There are many Java Development IDE but in this tutorial, we will use Eclipse. Eclipse IDE is used by professional developers. It provides a source code editor, build automation tools, a debugger and many other facilities which makes the software development process faster and easier.

Windows
  1. Download and Install Java JDK
  2. Download and Install Eclipse
MacOS
  1. Download and Install Java JDK
  2. Download and Install Eclipse
Ubuntu / Linux
  1. Download and Install Java JDK
  2. Download and Install Eclipse