Hi @Ashmita, to asnwer your question, lets go one by one:
1. Difference between JDK and JRE:
JDK is basically used for developing, testing and debugging java apps and applets. It can also be used to run the apps as it's a complete package and it contains JRE in it along with other tools like compilers, debuggers etc. While JRE provides the libraries, JVM and other necessary components to run the apps written in java. But JRE can't be used to create or modify the java applications.
So it totally depends on your usage... If you want to develop java applications, then you should install JDK. Otherwise if you just want to run some applets or apps, you can simply install JRE.
2. Installation steps for JDK:
- Go to this link: https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html to install the latest version of JDK i.e. JDK-11.0.2. Click on 'Accept Licence Agreement' and click on the highlighted file to download:
- Once clicked, the setup will start downloading and you can find it in the default 'Downloads' folder.
- After download gets completed, double click on the file to start installation. It will first ask for your permission to install the app. Click 'Yes'.
- Now the installation wizard window will pop-up. Click 'Next' to proceed further:
- Click 'Next' to install the default features installation. You can select optional features too, at this screen:
- After clicking 'Next' in above step, installer will start extracting the files and installing the JDK on your machine. once completed, you will see another window showing message "JDK Successfully Installed". Click 'Close' to close the installer wizard.
- Now open 'View Advanced System Settings' and it will open 'System Properties' window. Click on 'Environment Variables' :
- On Enviroment Variables screen, click on 'New' under 'System Variables' to add a new variable for Java path:
- Add the below mentioned 'Variable Name' & 'Variable Value' to your new environment variable and click 'OK' :
- And that's it. Your JDK is installed successfully. You can check for the same by opening Command Prompt and typing this command: 'javac -version'.
3. Installation Steps for JRE:
- Go to this link: https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html to install the latest version of JRE. Click on 'Accept Licence Agreement' and click on the highlighted file to download:
- Once downloaded, double click on the file and click on 'Install' to start installation wizard:
- Now installer will extract the files and start installing the setup. After successful completion, another window will display showing the message 'Successfully installed Java. Click 'Close' to close the installation wizard.
- And the JRE is installed on your system. To check the same, open 'Command Prompt' and type this command: 'java -version'.