At this point in your programming career, you’ve probably learned that there are a variety of tasks that programmer need to consider. Among other things, programmers must manage a variety of files, provide build instructions that combine the files, correct syntax errors in program code that the compiler identifies, find logic errors in their programs (sometimes by manual analysis, sometimes with a debugger), and remember a host of libraries.
Many programmers are quite happy doing all of these things with a variety of programs and with an editor like vi or emacs.
However, as the power of computers expands, programmers increasingly want to harness that power to make their tasks easier, and perhaps to integrate them into a single application. For example, why not have the editor tell you when you make a syntax error (and perhaps even suggest a solution) when you make the error, rather than much later, when you try to compile it? Why not have the editor suggest what procedure you want, rather than forcing you to scan through lots of documentation? And why not have the editor keep your files organized so that it can automatically figure out what and how to compile? Environments that combine these various development tasks are called “Integrated Development Environments” or more frequently “IDEs”.
What features can you expect an IDE to provide?
To some of you, all of these features may sound like the return of
Clippy
In the Java world, the two most popular IDEs seem to be Eclipse, from IBM, and NetBeans, from Oracle. There’s also a novice-friendly IDE called BlueJ. In this course, we will rely on the Eclipse IDE.
Eclipse is an open source IDE originally created by IBM in November
Here’s a quick glance at an Eclipse session in an older version of Eclipse.
Along the left side of the screen, you’ll see the package explorer.
That may need a bit of background to understand. While your work
to date has generally used one or two files, most of your Java
projects will involve many more files, and so you will find it
helpful to group them together. Java’s mechanism for grouping
related files is a package. For example, you might want a package
for ADTs you build or for a reuable part of a project. Java also
comes with a wide variety of packages. Traditionally, Java packages
are named with a reverse-url syntax, such as
edu.grinnell.cs.rebelsky.lists
for my list package or
edu.grinnell.glimmer.ushahidi
, for my research lab’s ushahidi
package.
But Eclipse goes a step further. A typical program involves multiple packages, and potentially some other things, too. Eclipse groups packages and other materials that go together into a “Project”. Each time you start a new assignment in this class, you will likely create a new project in Eclipse or load a project we’ve provided.
As you should be able to tell from the picture, the package manager gives you access to all of your projects. You can easily shrink and expand labels to delve deeply into parts of a project, and you can drag files from place to place.
In the center of the screen you’ll see the primary code editor. You’ll note that the code has been colored and highlighted to help the programmer identify the different parts. You’ll also note that there are multiple tabs, one for each open file.
Along the right hand side of the screen is an outline of the current file. You can use this to navigate to various parts of the file and to help remind yourself of its organization.
At the bottom of the screen are a series of tabs that serve a wide variety of purposes. Right now, they are open to the error messages. But you’ll also interact with programs there, view documentation, and more.
And, as always, at the top of the screen are a host of menus that you will need to spend a bit of time exploring on your own.