Java Getting started
This getting started is windows specific, but Im sure if you google, you’ll be able to find out how to do this stuff on your OS (operating system). I wont completely be holding your hand with these tutorials. Im going to asume you know how to install things and how to unzip and stuff like that. If you dont, programming basically all about problem solving, you will have to learn how to solve your own problems, usually googling your problem helps a lot.
To get started with coding java, you need a couple of things first:
JDK is short for Java Developers Kit and you will need to have this installed if you want to develop java. To download you have to go to the Oracle Download page and press download. That will bring you to a download selection page. There you have to tick Agree Lisence Agreement. If you are on a 64 bit pc be sure to download the x64 version. If you have a 32 bit pc or dont know what you have, download the x84 version.
Well I take you know how to install things so just run the exe you just download and install it. during installation you will probably be asked to install the JRE, this is the Java Runtime Environment. You most likely have this installed this already since that is whats needed to run java programs on your pc. Doesnt hurt to install it again though. At the time of writing this you will also asked to install JavaFX, feel free to skip this. If you want to know what it is use google.
So you have installed the JDK now, but you arent done yet. Now comes the tricky part making windows be able to use it. You have to let windows know where you intalled the JDK otherwise it wont be able to use it. You do this by adding the JDK bin location to your Windows Path. Now why this isnt done automatically when you install it I dont know. Anyway you have to go to your Environment Variables. Where these are located slightly variables per Windows. Ill explain it for Windows 7, but Im sure if you use google you’ll be able to find how its done for your windows.
Go to Control Panel -> System -> Advanced System Settings -> Enviroment Variables. That wasn’t so hard right? Now be careful these are settings your windows needs to run properly so no messing around. Now look at the System variables and find the path and double click it. This should look something like:
Now go the end of the Variable value and if there isnt a semicolon there add one. Now find out where your JDK installed. This is probably in your C:\Program Files\Java and go into your JDK and than bin folder and copy the path. At the time of writing this is C:\Program Files\Java\jdk1.7.0_05\bin. Now take that path and copy it after the semicolon you placed in the Path varuable value. Once again make sure you dont delete anything in it, this could mess up your windows. After doing this press ok.
Now you should have succesfully installed the JDK. You can test this by hitting your windowskey + r -> type in cmd and hit enter, a command promt should now pop up. Type in the command prompt: java and hit enter. If it gives you a bunch of text with explanations how to use it than its installed correctly. If it says ‘java’ is not recognized as an internal or external command, operable program or batch file. it didnt install correctly.
Eclipse is a free IDE for java. An IDE is an Integrated Development Enviroment. Its basically a tool made to make programming easier. Ill be using eclipse for the upcoming tutorials. Ofcourse there are more IDEs for java or if you are really ‘hardcore’ you can ofcourse not use an IDE and just use notepad to code in. That is your own desision. Though if you are a starter I suggest you start with eclipse.
Go to the eclipse download page and download the standard eclipse. Reminder if you downloaded the 64 bit JDK you have to use the 64 bit eclipse and 32 if you got the 32 bit JDK. This will give you a zip file. Unzip the folder where you want. I ususally do it to my c:/ or c:/program files. Now go into the folder and run eclipse.exe. If it doesnt run you either installed the wrong version of eclipse or didnt install your jdk. Either way go to the eclipse forum to get help.
When you start eclipse it will ask what workspace you want to use. I for example have different workspaces for: school, work, private, testing etc. You can make as many workspaces as you want. For these tutorial workspaces I suggest you create a WorkspaceTutorials or something similar like that.