This tutorial introduces Java and goes over the steps you need to follow to program Java on your computer. When we get to the programming part, Iâm going to assume youâve already been through the Processing tutorials. If you havenât done them yet, go do them before moving on to Java!
Since youâll be writing code, you need to download the Java Development Kit, aka the JDK. Go here and find the download button that says JDK (not JRE) and click that. That takes you to a page containing OS-specific download files. Download the one for your computer!

When the download completes, run the installer. The default settings should be fine. Remember where the installer puts Java- youâll need that location in the next step!
PATH is an environment variable that tells your computer where programs are located. We need to make sure that Java is on your PATH.
Here are instructions for setting the PATH on different operating systems.
On Windows 10, you can open the start menu and just type âpathâ which will show you an option for editing the system environment variables. Click that, which opens the System Properties dialog:

On that screen, click the âEnvironment Variablesâ¦â button, which opens up the Environment Variables dialog:

On that screen, find a variable called PATH, select it, and click the Edit... button.

Finally, on that screen, click the New button and then paste the path the installer put Java. Itâs usually something like C:\Program Files\Java\jdk1.8.0_121\bin, but with different numbers depending on the latest version of Java. Note that the path ends in a bin folder!
Press OK in all the dialogs to accept your changes.
The command prompt is a text-based interface that lets you interact with the computer without any windows. Itâs how a lot of coding tools are run, and itâs how weâre going to work with Java for now.
To open the command prompt, go to the start menu and then type âcommandâ until you see a shortcut that says Command Prompt. Click that to open the command prompt, which looks like this:

You can use the command prompt by typing commands and pressing the enter key. Try these commands:
dir lists everything in the current directory. Type dir and press enter, and you should see a list of files.
cd changes directories. Try to cd into one of the directories listed by the dir command. For example, to cd to my desktop I would type cd desktop and then press enter. If you want to go up a level, type cd .. and press enter.
mkdir creates a directory. Type mkdir HelloJava to create a directory named HelloJava. Then cd into it by typing cd HelloJava and pressing enter.
javac runs the Java compiler. Weâll talk more about this in the next tutorial, but for now type javac -version and hit enter. That should print out the version of Java you just installed. If you get an error here, make sure youâve set your PATH correctly!
java runs Java programs. Weâll also talk more about this in the next tutorial, but for now type java -version and hit enter. That should print out the version of Java you just installed. If you get an error here, make sure youâve set your PATH correctly!
PATH variable is.