How to Download and Install Java?
1. To download Java Click Here
2. After successfully downloaded, install the exe file.
3. To check installation, goto C:\Program Files\Java\jdk- ’version’\bin then open CMD here and type java
The JVM has JIT(Just In Time Compiler) OR Interpreter that converts Byte-Code to Machine Language.
How to Set Environment Variable?
1. Copy your bin folder path (Ex. C:\ProgramFiles\Java\jdk-’version’\bin ).
2. Right click on My Computer / This Pc.
3. Click on Properties
4. Click on Advanced System Settings
5. Choose Environment Variables
6. Here you can set variable for either System or User
7. Click on ‘New’ button
8. Set Variable Name as ‘PATH’ & Variable Value must be your copied path
9. Now Click ‘Ok’ then ‘Apply’
Why we set Environment Variable?
To compile a java program we use the ‘javac filename.java’ command in CMD. Javac file resides in C:\Program Files\Java\jdk- ’version’\bin folder.
Without set Environment Variable every time we want to compile our program we have to type the full path of javac (C:\Program Files\Java\jdk-’version’\bin\javac) in CMD. To simply use javac instead of its full path, we set an environment variable.
After Set Environment Variable, we can use Java Compiler by simply type ‘javac’ in CMD from anywhere (any drive). CMD knows its full path from the Variable that we have set before.
If you have any Questions or Queries
You can mail us at info.learnoset@gmail.com
Follow us to learn Coding and get in touch with new Technologies.