In my last tutorial(http://forum.codecal...-hello-to-java/),We talked about how to create a "Hello World" application as a worm up.But if you are a complete newbie to java this might confuse you.So I'm going to give a short introduction about setting up Java and an IDE.
There are two versions of java that you can set up on your computer,
JRE is the run time environment for Java application.That means JRE is only could be used to run a compiled Java .class file or .jar file.This cannot be usable to compile java applications!
JDK means Java Development Kit.This is the version developers should use.JDK enables us to develop,compile,package,etc,etc... Java applications.
So now we want to get JDK.Go to the above link,select your prefered JDK version (may be Java SE 7U6) ,
Then under "Java SE Development Kit 7u6" (or under something similar to this) select the version compatible with your operating system(For me it's Windows x86 : jdk-7u6-windows-i586.exe).You must accept the license agreement before downloading!.This download will be around 90MBs for Windows x86.
After download completes run the setup file jdk-7u6-windows-i586.exe.You will be asked to gain admin privileges for the setup if you are using UAC on Windows 7 and vista,Click Yes.Then you will be asked to Install JDK.Keep clicking next
On this click continue and you are done installing Java!
But we still have few little things to do,
Open a command window (Windows key + R and type cmd),
This will output something like this
Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) ................. ................... ................................
If not,There is something wrong with your Java installation.Try re-install.
This will probably output,
'javac' is not recognized as an internal or external command, operable program or batch file.
If not you good to go.
But if this happens,you have to set up the PATH environment variable,
To do this right-click on "Computer" icon ("My computer on XP"),Click "Advanced System settings".
In the next window select "Advanced" tab and click the "Environment Variables..." button.
Next window,Under "System variables".Select "Path" and click "edit..."
Add a semicolon ";" at the end of the line and past your jdk/bin folder path (For me C:\Program Files\Java\jdk1.7.0_04\bin).
Click "Ok" on all three windows and log out and log in.
Open a command window,
This time It will give proper outputs.If not check everything again.
Install an IDE
IDE means "Integrated Development Environment".An IDE is a software that makes programming easy.It has a integrated code editor giving ability of fast coding and etc..
For Java there are quite a lot of IDEs available,
Search Google for "Java IDE" and you will find out some.
The most popular ones are Eclipse(http://www.eclipse.org),NetBeans(www.netbeans.org) and Jbuilder.
I'm going to tell how to set up and use NetBeans.
Go to the NetBeans page and click the "Download x.x" on the top of the page.
In the next page select "Java SE",The download will start.
After download completes run the setup and install like any other software.Give the JDK path if asked.
Open NetBeans from desktop shortcut or Start menu.Program may load for few minutes.(Of cause it's a huge software )
Select "Java" from the Left side box and select "Java Application"
Then Give a project a name and a project path.
This is your code window.Try some code and Click Run>Run Main Project to test your code.
Here is a simple Hello World NetBeans project,Download it and test out.Just go to File>Open and select the extracted project folder.
Hello World.zip 358.12KB 319 downloads
Any questions or comments are welcome.See you In next tutorial.