%%
Last Updated:
- [[2021-04-12]]
%%
Below are instructions on how to install [[Java]].
## Check if Java is installed
First, check whether Java installed and ready to use on your computer. In the command prompt, type `java -version`. It should come back with something like:
```javascript
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode, sharing)
```
If you see something similar as an output, then you're all set for Java.
If that's not what your terminal returns, then you'll need to check whether Java is actually installed on your computer but is not being recognised. The default installation path of Java is `C:\Program Files (x86)\Java\jre7`.
## If Java has not yet been installed
[Download the latest version](https://www.oracle.com/java/technologies/javase-downloads.html) of the [[Java Development Kit]]. Once it has been downloaded and installed, type `java -version` again in the command prompt. If you get the right response, you've installed it successfully.
## If Java has been installed but java -version throws an error
Check to see if the environment variable has been set for Java. I don't know why, but the environment variable is sometimes not set, especially in Windows. The environment variable not being set means that while Java is installed, your computer isn't finding Java automatically. In order to help it, you need to show it where Java lives. (More common for [[Microsoft Windows]]).
- Right click on My Computer.
- Click Properties.
- Click Advanced System Settings.
- Click Environment Variables.
- In the System Variables section, find the variable called Path. Edit it.
_Note: If you don't have administrator rights on the computer, you can just create a new Path variable in the User Variables section._
At the very end, add: `;C:\Program Files (x86)\Java\jre7\bin\` to the variable and save it.
The `;` is to separate the string from the previous one. Disregard if there's nothing in the Path variable.
Now try `java -version` in the command prompt again. This should now give you the correct response.