Activities carried out on the computer usually begin with the installation of something, and programming is no exception.
But before we delve into that, let me start with some general facts.
All programming is done via some programming language. There are literally thousands of programming languages in existence. Some are designed to fulfill a specific niche, while others are created for programming in general.
The language we’ll be using here is Java, initially known as Oak. It was invented circa 1995 by a guy named James Gosling, and it was originally intended to be used in set top boxes, but it ultimately became popular for general purpose programming, especially programming on the internet.
Java is a popular language, and it’s easier to learn than the languages that preceded it, so I thought it would be a great language to teach the concepts of programming in general.
But before we can start programming in Java, it’s necessary that we install and configure it. And before we can install it, it’s necessary that we download it.
Therefore, it’s necessary you go here: http://java.sun.com/javase/downloads/index.jsp
We’re going to be downloading the JDK, which as you’ll see stands for Java Standard Edition Development Kit. As of today the most recent JDK is # 6, update 14. Get that one.
You’re going to be a developer now, isn’t that exciting?
But don’t get excited yet, we still have a bit more tutorial to get through.
So once the JDK is finished moving to your computer, install it.
This is a ridiculously simple process, so I won’t say much about it. Just keep clicking ‘next’ until the installation wizard says it’s finished.
By the way, I’m assuming that you’re using Windows XP. If not, now would be the time to find another installation tutorial.
So once it’s installed, it’s time to configure it. Get ready.
-
First, click the Start button.
-
Then, click Control Panel.
-
Next click the System icon.
-
Click the Advanced tab.
-
Click Environment Variables.
-
Under System variables, edit your path variable to begin with: .;
-
Then, directly after the semicolon from step 6, add the directory path to where Java was installed.
-
#8 is just an example for step 7, don’t worry. Ex: C:\Program Files\Java\jdk1.6.0_14\bin;
-
Make sure the path ends in a semicolon, like with the example provided in the previous step.
- You’re done! Keep clicking ‘Ok’ until there are no more windows left.
What you just did enables you to access the Java compiler (And other programs located within the Java folder) from the command line, no matter what directory you’re in.
That may not make much sense to you at the moment, but it will soon. Maybe.
We’re actually almost finished, we just need to check that you did everything properly.
Click Start again, and then click Run and type in ‘cmd’ and press enter on the keyboard.
That black window that just popped up is called a console window, and we’re going to be making good friends with it.
In the window, type javac -version and press enter.
Then, type java -version and press enter again.
If you did that correctly, then the version information for Java should be displayed. If not, scroll back up and find your mistake, or find mine.
If you’ve made it this far then congratulations, you just successfully installed and configured Java.
You can get excited now.