
Downloading and Installing | Tutorials and Help | An Example | Back to Freestuff Home
Eclipse is awesome. Eclipse is a free IDE or Integrated Development Environment. Now all that means is it's one application that you can use to edit, debug, compile and run your programs. It's like one stop shopping. Some of the advantages are that it makes it easy to put components together (icons, code libraries, other resources) and manage everything as one project. Instead of going to a command line and typing "java MyProg" you can just hit a button and the IDE runs your program inside the environment.
There are some disadvantages. Some people would say that IDEs sometimes hide the complexity of programming from the programmer and do too much of the work. For example, if I just pick "Dialog Box" out of a menu and drag and drop it onto a frame do I really know the programming that's going on behind the scenes? You can always go and look at the raw code, but people rarely do. Like Visual Basic, you can often just right-click and set properties with IDEs. Many would say that this is not programming, but "making" an application with pre-written code. The line is fuzzy and the question will always be asked "Could you do that with just an editor and a JDK?"
I do this. I make sure I know what's going on behind the scenes by always doing a first project without an IDE. Just grab Notepad or Wordpad and type away. I compile from the command line until all the bugs are worked out and I understand what I'm doing. Then, later, when I have a clue and realize how tedious and boring creating a Graphical User Interface can be I will use an IDE to create a basic framework that I can customize to my needs. Even so, Java IDEs are not as forgiving as Microsoft's Visual Studio products. You will have to know your stuff. Nuff of that. Let's get started.
Eclipse, eclipse, eclipse. We are going to download eclipse and use it as an IDE for Java applications. Eclipse is much more though. Eclipse is made so you can make your own modules, use it as a host to develop applications on top of it, it even has it's own GUI toolset, but don't worry about that for now. You can dig into all that stuff later if you like. Right now all you need to know is that Eclipse was an internal project at IBM that was made to create an extensible platform for application development. An integration platform so you could take your favorite editor and put it together with your favorite compiler and such. It went open source in 2001 and IBM actually donated $40 million bucks to the effort. Four years later and eclipse.org is the home of the eclipse foundation. It's like a religion to some. They even have bylaws. These people are serious about their IDEs. There have been over tens of millions of downloads of the eclipse package since it went open source.
We are concentrating on Eclipse because it's a great tool for building Java Apps. It works with Tomcat (for Servlets and JSP for the web), Ant (a build tool for Java) and a thing called Unit testing with JUnit (worry about that later). There are other tools out there, like JBuilder from Borland and there are even other free tools, like netBeans, but we concentrate on Eclipse because once you learn how to use it you can do so much more than just Java (you can use it for C++, Perl, a customized help system) whereas the other tools are more specific and only used for a particular programming language. That's not to say that Eclipse doesn't concentrate on Java. It does. It's JDT (Java Development Tools) are as good as any other product out there. It's the most popular IDE for Java development right now by far. If you do a google search on IDE look at the first link. Nuff said. Enough of this though. Now you know what Eclipse is about, let's go get it.
Go here... http://www.eclipse.org

It'll bring you here.... Click on the download link...

That's the version we're looking for. Don't right click. Click on the link and it will bring you to a page full of mirror sites...

The University of Buffalo Site is nice and close. Go ahead and click the link and your download should start. If you didn't go through the Java setup with these pages, I usually setup a directory called C:\Temp for setup files, so that's where I'm going to download this file to.

The download takes a bit, it's over 100 megs, but when you're done go to Windows Explorer (Start->All Programs->Accessories->Windows Explorer) and look at the directory where you downloaded the setup file.

Now, all you have to do is right click the zip file, and hit extract (I have Winzip so you're display make look different. It may just say "Extract All..". That's cool, It's the same thing) Extract the files to "C:\Program Files". Don't worry, it'll all be unzipped into one folder called eclipse.

After the extraction, navigate to C:\Program Files\eclipse...

Right click on the eclipse.exe, click on "Send To" and click on "Desktop (Create Shortcut)"....

It'll give you a desktop icon... go ahead and double click it.... Click OK when you get the default workspace...
(If you want to change the name of the icon just click on the words once to highlight it. Wait two seconds, now click once again. just type "eclipse" or whatever you want to call it)

You're done. Eclipse has no install program. You just unpack the package and run the program.
One of the big pluses about eclipse is the support. There are tons of tutorials and tons of help files for everything from creating your first program to building and eclipse application from scratch. When you first start eclipse it's a good idea to look around and get used to some of the new terms, like perspectives and views, but everything is pretty straight forward. When you first start the application you are shown icons for the major documentation areas. You can immediately take tutorials to get familiar with eclipse. Check them out. When you go into eclipse a second time the icons won't appear again, but you can always get them back by clicking on "Help" and then "Welcome". There's also a ton of help on the web also. Just Google Eclipse Help and take a look.
If you want a few books then there's only two you need, O'Reilly's Eclipse by Holzner and The Java Developer's Guide to Eclipse, from the IBM folks who developed eclipse.
Sometimes Eclipse seems overwhelming to beginners. Don't worry. Relax. Tinker with it and everything will become clear. It's easy to use and it works great.
We will do one example with the code we created when we downloaded the Java JDK.

Alright, a quick "Hello World". See the Workbench arrow in the upper right hand corner of the eclipse window? Click it. You'll get the blank eclipse workbench above.

Go to File -> New -> Project and you'll get the New Project Window above. Click on "Java Project" and click "Next"

If you did the example I used for the Java page you have this file already done. If not, go look at the code real quick. It's just a hello world program. Fire up Notepad and type it into a file called C:\MyJava\Hello\Hello.java and you can do what I'm doing here.
Call the project Hello, click on Create from existing source, and hit Next...

Now you'll get the settings page. You don't need to mess with this now, but in the future you will... click "Finish"...

Now you have the classic IDE feel goin on. Code in an editor window to the right, project manager and viewer on the left and an output console and debugging windows on the bottom. Back in the eighties the old compilers like Turbo Pascal and Borland C++ looked like this. Enough reminiscing, lets run the code. See the Green Button with the White Arrow in it? It's right below the word Eclipse in the title bar. Not the little one, the bigger one on the left... Go ahead and click it.

Now you get the "Run" window. You only have to set it up once. It's here where you have to tell Eclipse how you want to run your program. In the future you may have certain data you want to use, or a different JRE, so the "Run" window gives you the option to set a whole bunch of parameters for the execution of the code. You click on "Java Application" and then click the "New" button to get where I am above. We don't need anything special, but you can see where you can go to change options later when you create more complex programs. Right now we just want to hit the "Run" button in the lower rigtht hand corner.

And there we have it. The Output window console at the bottom of the IDE acts as standard output (the console) and you see what you wanted to print. Congratulations, you have just compiled and ran a Java program using Eclipse. This is just the beginning. The world of Eclipse is vast, interesting and free. Have fun with it.
If you have any questions, suggestions, or corrections please let me know...

© 2007 Rutgers University