For working professionals
For fresh graduates
More
Step by Step Java Tutorial Con…
1. Introduction to Java
2. What is Java?
3. History of Java
4. Java Tutorial for Beginners
5. How Do Java Programs Work?
6. JDK in Java
Now Reading
12 mins read
7. C++ Vs Java
8. Java vs. Python
9. Java vs. JavaScript
10. From Java Source Code to Executable
11. How to Install Java in Linux
12. How to Install Java in Windows 10
13. Java Hello World Program
14. Structure of Java Program and Java Syntax
15. Operators in Java
16. Java If-else
17. Switch Case In Java
18. Loops in Java
19. Infinite loop in Java
20. For Loop in Java
21. For Each Loop in Java
22. Constructor in Java
23. Constructor Overloading in Java
24. Copy Constructor in Java
25. Default Constructor in Java
26. Parameterized Constructors in Java
27. Constructor Chaining In Java
28. Finalize Method in Java
29. Static Method in Java
30. Equals Method in Java
31. Abstract Method in Java
32. toString() Method in Java
33. Difference between equals method in Java
34. Inheritance in Java
35. Multiple Inheritance in Java
36. Hierarchical Inheritance in Java
37. Java Classes and Objects
38. Scanner Class in java
39. All classes in java are inherited from which class
40. What is Nested Class in Java
41. POJO Class in Java
42. Anonymous Class in Java
43. Final Class in Java
44. Object Class in Java
45. Packages in Java
46. Access Modifiers in Java
47. Static Keyword In Java
48. Final Keyword in Java
49. Checked and Unchecked Exceptions in Java
50. User Defined Exception in Java
51. Error vs. Exception in Java
52. Java Collection
53. Collections in Java
54. Garbage Collection in Java
55. Generics In Java
56. Java Interfaces
57. Functional Interface in Java
58. Marker Interface in Java
59. Streams in Java
60. Byte stream in java
61. File Handling in Java
62. Thread in Java
63. Thread Lifecycle In Java
64. Daemon Thread in Java
65. Thread Priority in Java
66. Deadlock in Java
67. String Pool in Java
68. Java Database Connectivity(JDBC)
69. Design Patterns in Java
70. Functional Programming in Java
71. OOP vs Functional vs Procedural
72. Heap Memory and Stack Memory in Java
73. Applet in Java
74. Java Swing
75. Java Frameworks
76. Hibernate Framework
77. JUnit Testing
78. How to Install Eclipse IDE for Java?
79. Command line arguments in Java
80. Jar file in Java
81. Java Clean Code
82. OOPs Concepts in Java
83. Java OOPs Concepts
84. Overloading vs Overriding in Java
85. Java 8 features
86. String in Java
87. String to int in Java
88. Why String Is Immutable in Java?
89. Primitive Data Types in Java
90. Non-Primitive Data Types in Java
91. This and Super Keyword in Java
92. HashMap in Java
93. Comparable And Comparator in Java
94. Type Casting in Java
95. Arrays Sort in Java with Examples
96. Variable Hiding and Variable Shadowing in Java
97. Enum in Java
98. Substring in Java
99. Pattern Programs in Java
100. Hashcode in Java
101. What is ByteCode in Java?
102. How To Take Input From User in Java
103. GCD of Two Numbers in Java
104. Linked List in Java
105. Arithmetic Operators in Java
106. Conditional Operators in Java
107. Stack and Queue in Java
108. Array Length in Java
109. Number Pattern Program in Java
110. Split in java
111. Map In Java
112. Difference Between Throw and Throws in Java
113. Difference Between Data Hiding and Abstraction
114. HashSet in Java
115. String Length in Java
116. Factorial Using Recursion in Java
117. DateFormat in Java
118. StringBuilder Class in java
119. Instance variables in Java
120. Java List Size
121. Java APIs
122. Reverse an Array in Java
123. StringBuffer and StringBuilder Difference in Java
124. Java Program to Add Two Numbers
125. String to Array in Java
126. Regular Expressions in Java
127. Identifiers in Java
128. Data Structures in Java
129. Set in Java
130. Pass By Value and Call By Reference in Java
131. Try Catch in Java
132. Bubble Sort in Java
133. Caesar Cipher Program in Java
134. Queue in Java
135. Object Creation in Java
136. Multidimensional Array in Java
137. How to Read a File in Java
138. String Comparison in Java
139. Volatile Keyword in Java
140. Control Statements in Java
141. Jagged Array in Java
142. Two-Dimensional Array in Java
143. Java String Format
144. Replace in Java
145. charAt() in Java
146. CompareTo in Java
147. Matrix Multiplication in Java
148. Static Variable in Java
149. Event Handling in Java
150. parseInt in Java
151. Java ArrayList forEach
152. Abstraction in Java
153. String Input in Java
154. Logical Operators in Java
155. instanceof in Java
156. Math Floor in Java
157. Selection Sort Java
158. int to char in Java
159. Stringtokenizer in java
160. Implementing and Manipulating Abs in Java
161. Char array to string in java
162. Convert Double To String In Java
163. Deque in Java
164. Converting a List to an Array in Java
165. The Max function in java
166. Removing whitespace from string in java
167. String arrays in Java
168. Strings in Java Vs Strings in Cpp
169. Sum of digits of a number in Java
170. Art of Graphical User Interfaces
171. Trim in Java
172. RxJava
173. Recursion in Java
174. HashSet Java
175. Difference Between Java and Python
176. Square Root in Java
177. Reverse A String in Java
178. Even Odd Program in Java
179. Fibonacci Series in Java
180. Prime Number Program in Java
181. Java Program to Print Prime Numbers in a Given Range
182. Java Leap Year Program
183. Swapping of Two Numbers in Java
184. LCM of Two Numbers in Java
185. Math.sqrt() Function in Java
186. Area of Triangle in Java
187. Sort a String In Java
188. Factorial Program in Java
189. Javafx
190. Lambda expression in java
191. Setup Java Home and IDE on macOS
In the early 1990s, under the leadership of James Gosling (a Canadian computer scientist), a group of developers at Sun Microsystems began developing a novel programming language called "Oak." Oak was designed for embedded systems, which initially encompassed consumer electronics. However, as the days passed, Sun Microsystems realized that Oak had a higher calling.
Sun Microsystems formally renamed the language "Oak" to Java, as the name Oak was already owned by another company.
The Java Development Kit, or JDK in Java, is a set of tools and libraries that programmers use to create Java-based applets, and that’s why it is called a Development Kit.
We will examine JDK in this tutorial. You will learn about the JDK composition and architecture and how to install it on your system. Read on to learn more.
The JDK was initially released on January 23, 1996.
The JVM and JRE are responsible for executing and running Java programs, and the JDK supplies the necessary tools. If you are new to Java, then you might get the Java Runtime Environment (JRE), the Java Development Kit (JDK), and the Java Virtual Machine(JVM) mixed up.
JDK full form in Java is Java Development Kit. It contains the JRE, an amalgamation of the JVM and libraries. It also contains the Java developer tools, i.e., javac, javadoc, and the Java debugger.
JDK is used to develop Java applications and create executable programs using the Java programming language. The architecture of JDK is designed to support the Java programming language. The JDK includes the following components:
You'd know what layers are if you've read a bit about operating systems. So, what is JRE?
JRE or Java Runtime Environment is a software layer that provides the essential libraries and resources a Java Program requires. It runs on top of your machine's OS (Operating System).
The JRE is responsible for combining the Java code created by the JDK with the libraries required to run the program and then creates an instance of the JVM, where the program executes.
Java Virtual Machine or JVM is, just as the name suggests, a virtual or abstract machine that enables users to run their Java applications. Java programs or applications have a trait called WORA or ‘Write Once Run Anywhere.’ So you can write a program on your system, then send it to another system where Java is enabled and expect it to run there.
When you write a program in Java, the source code is automatically saved as a file with a ‘.java’ extension. When you compile this code, the computer uses the Java compiler to convert this ‘.java’ file into a ‘.class’ file, which is machine-readable bytecode.
This ‘.class’ file is processed through an array of steps when we execute it, which is what the JVM enables.
The JDK contains a wide variety of tools, each having its own unique feature. These tools are mentioned down below:
Tool | Description |
java | Java interpreter or loader |
javac | Java compiler used to compile Java source code into bytecode. |
javadoc | Java documentation generator used to generate documentation from Java source code. |
jar | Java archive tool used to package Java applications and libraries into a single file. |
jps | Java process status tool used to list the Java processes running on a system. |
appletviewer | Tool used to view Java applets. |
idlj | IDL-to-Java compiler is used to generate Java code from CORBA Interface Definition Language (IDL) files. |
javap | Java class file disassembler used to display the contents of Java class files. |
JConsole | Java monitoring and management console used to monitor and manage Java applications. |
javah | Java header file generator used to generate C header files from Java classes. |
javaws | Java web start tool used to launch Java applications from the web. |
jhat | Java heap analysis tool used to analyze heap dumps generated by Java applications. |
jmc | Java mission control tool used to monitor and manage Java applications. |
The JDK in Java contains a wide variety of tools. The main components of JDK are mentioned below:
Java Development Kits have come a long way since its first release. However, some versions are used more than the others. Here are the most popular JDKs:
Release Year: 2014
It is a Java version with long-term support (LTS) that remains widely used today. It includes features like the Stream API, lambda expressions, and the Date-Time API.
Release Year: 2018
JDK 11 is also an LTS version of Java. It introduced new features such as the HttpClient API, the VarHandle API, and improvements to the garbage collector.
Release Year: 2020
JDK 14 introduced features such as switch expressions, NIO2 enhancements, and the new packaging tool ‘jpackage’.
Release Year: 2020
JDK 15 introduced features such as sealed classes, hidden classes, and improvements to the garbage collector.
Release Year: 2021
Features such as record classes, pattern matching for instanceof, and enhancements to the garbage collector were among the new additions this release included.
Coming to setting up JDK on your system, you need to adhere to the following steps to ensure that JDK is successfully installed and runs on your machine without any hindrance:
To set the JAVA_HOME environment variable, follow the steps mentioned below:
You have now successfully set the JAVA_HOME variable for your Windows system.
To compile and run code using JDK, follow the steps below:
Let’s say you have a Java-based application created on your system and want to share it with your fellow developers. You would want to compress the files to save on storage. To do this, you must create a “.jar” file containing all the files in your Java-based application. Follow the steps below to create a “.jar” file:
JDK 20, the most recent release, was circulated on March 21, 2023. JDK 20 was released as a “patch release,” while JDK 17 is the current Long Term Support (LTS) release.
JDK 20 comes with a lot of new features and improvements, such as:
The most credible source to start using JDK is the official JDK documentation. Understanding the elements of a Java program is easier when you have the documentation by your side.
You can start by creating your first class and typing the source code in a “.txt” file. Rename the file extension as “.java” from “.txt” and then use JDK from the command prompt to compile and execute your Java program.
The JDK in Java was one of their best and long-lasting creations of all time. JDK is still widely used by the IT industry, especially JDK 8. JDK provides many tools to compile, run, test, and debug Java applications. Creating Java applications without the JDK would be extremely difficult, so it is still being worked on and updated with new features at every single release.
1. What is JDK and JRE?
is Java Development Kit, while JRE stands for Java Runtime Environment. They both necessitate the development of Java-based applications along with the JVM(Java Virtual Machine).
2. Is JDK only available for Windows?
JDK is available for Windows, Mac, and Linux. You can go to the downloads page and download the installer suitable for your Operating System.
3. What is the difference between JDK, JRE, and JVM?
The JDK is a set of tools for creating a complete Java-based application, while the JRE lets you execute Java code correctly. JVM is a virtual machine that enables you to run the code on your system.
Take the Free Quiz on Java
Answer quick questions and assess your Java knowledge
Author
Talk to our experts. We are available 7 days a week, 9 AM to 12 AM (midnight)
Indian Nationals
1800 210 2020
Foreign Nationals
+918045604032
1.The above statistics depend on various factors and individual results may vary. Past performance is no guarantee of future results.
2.The student assumes full responsibility for all expenses associated with visas, travel, & related costs. upGrad does not provide any a.