After understanding basic concept of Java (introduction to Java), let us learn how to install Java to your machine.
1. Process to install Java
Uninstall if already any java related software got installed.
- In window machine, Go to Start >
- Click on ‘Control Panel’ > Click on ‘Uninstall a program’ link under ‘Programs’ >
- Select java related install from list > Right click > Click on ‘Uninstall’ link > Uninstalled successfully.
- Goto https://www.oracle.com/technetwork/java/javase/downloads/index.html
- Under ‘Java Platform, Standard Edition’, click on ‘Download’ for required version
- Click on ‘Accept License Agreement’ radio button.
- Select your OS (i.e. windows) and download installer (dk-8u201-windows-i586.exe).
Install JDK and JRE
- Click on downloaded ‘dk-8u201-windows-i586.exe’.
- By default JDK and JRE will be installed in ‘C:\Program Files\Java\jdk’ and ‘C:\Program Files\Java\jre’ respectively.
Check java installed or not in your system
Step 1: Navigate to command prompt. (Start > type ‘CMD’ on search box > Press Enter > command prompt will open)
Step 2: Type ‘cd/’ > press Enter to revert back to C:\ folder path
Step 3: type ‘java –version’ (Installed java version will be displayed like -> java version “1.8.0_201” on command prompt will be displayed)
It has been confirmed that java is installed successfully.
Note: Above steps mentioned for window platform and please comment if needed steps for other platform too. Also drop a comment if required still more details.
2. Process To Set Environment Variable In Java
What is java environment variable?
Environment variable is a global system variable accessible by all the processes running under the OS.
Why Environment variable path set is required?
If you are saving the Java source file inside the JDK/bin directory, the path is not required to be set because all the tools will be available in the current directory. However, if you have your Java file outside the JDK/bin folder, it is necessary to set the path of JDK. PATH stores a list of directories for searching executable programs.
What if environment variable not set?
We get compile errors like,
Error: 'javac' is not recognized as an internal or external command, operable program or batch file.
environment variable HOME is not set. The following directory will be used to
store the Git.
How to set environment variable?
- Start > Computer (right click) > Properties > Advance system settings > Click on ‘Advanced tab’ > Environment variables > click on ‘New’ under ‘System variable’ > Write ‘Path’ on Variable name field (if path variable not exist) > paste the jdk bin path on variable value field (C:\Program Files\Java\jdk11.0.1_131\bin)
- Close all remaining windows by clicking OK.
3. Process To Install Eclipse
- Click on link https://www.eclipse.org/downloads/packages/release/
- All eclipse versions will be displayed here
- Select the required eclipse version.
- Here we are selecting version ‘Kepler’ for Window7-32 bit
- Select version depends on your machine.
- Unzip the downloaded file and place the complete folder in required location.
- Open downloaded folder > Open folder Eclipse > Click on ‘Eclipse’ icon to launch Eclipse.
Note: No more installation required for eclipse.
- Close Welcome window and start work on it.