The Java Development Kit (JDK), officially called "Java Platform Standard Edition" or "Java SE" is required for writing Java programs. JDK is available free of charge from Sun Microsystems (now part of Oracle). The mother site of JDK (Java SE) is http://www.oracle.com/technetwork/java/javase/overview/index.html.
JRE (Java Runtime) is required to run Java programs. To write and run Java programs, JDK (Java Development Kit), which includes JRE plus development tools (e.g. compiler and debugger) is needed. In other words, JRE is a subset of JDK. You should install JDK, which includes JRE, as you need both as a developer.
Step 1: First uninstall the older version of JDK/JRE
We recommend that only the latest JDK be installed. Although it is possible to install multiple versions of JDK / JRE simultaneously, it is messy.
If you have an older version(s) of JDK/JRE in your system, uninstall ALL of them. Go to control panel and uninstall java.
Step 2: Now download latest JDK
Execute the downloaded installer which will install both the JDK and JRE.
In the "C:\Program Files\Java\jdk-11.0.{v }" directory, where {v} denotes the update number, JDK is installed by default. Accept the defaults and follow the JDK installation instructions on the screen.
In this article, we will refer to the JDK installed directory as < JAVA HOME>.
Step 3: Set path for JDK
Path and Classpath are variables of the environment at the operating system level. Path is used to define where the executables(.exe) files can be found by the system and classpath is used to specify the files.class location. In your java program, the path is set to use java tool such as java, javac, javap. Javac is used for code compilation.
Step 4: Check if JDK installed correctly
Many Java applications (e.g. Tomcat) require setting the JAVA_HOME environment variable to the JDK directory.
To set the JAVA_HOME environment variable please follow the below steps:
Notes: Windows environment variables are NOT case-sensitive (such as JAVA HOME, PATH).
Keep sharing blogs like this one; they are quite good. You have given everyone in this blog access to a wealth of information.
Thank you for your valuable information.
Thank you for this wonderful article!
This article was really helpful to me, thank you!
super article!
Leave a Reply
Your email address will not be published. Required fields are marked *