Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

An introduction to Eclipse for Visual Studio users

Added 31 Jul 2008

Eclipse Workspace:

Generally speaking, the Eclipse workspace serves the same purpose as a Visual Studio solution: It organizes top-level projects, folders, and files in a hierarchical structure. However, there are some major differences. A Visual Studio solution merely lists the projects it contains with their interdependencies, configurations, version-control information, etc.

The Eclipse workspace does much more than that. It manages most of the nonproject information, such as global preferences, windows layout, and search and navigation history. Eclipse can't start without a workspace, and you can't close a workspace the same way you can close a Visual Studio solution. Although it is possible to switch workspaces in Eclipse, many users use a single workspace that contains all their projects.

Project Structure:

Eclipse projects differ from Visual Studio projects in the way they interact with the underlying filesystem. In Visual Studio, a project isn't strongly connected to its layout on the filesystem: You can add a file from c:\temp\ to a project located in d:\work, and Visual Studio records the reference to a new file and opens it like any other file. Folders (like "header files") don't correspond to filesystem folders (internally, such folders are called filters).

In Eclipse, the structure of a project's elements must correspond to their layout in the underlying filesystem. For example, if the Eclipse project HelloWorld (see Figure 1) is located at c:\eclipse\workspace\HelloWorld, then README.TXT is located at c:\eclipse\workspace\HelloWorld\src\README.TXT.

The strict workspace structure was how things began. Although projects could be stored outside the workspace directory, early Eclipse versions couldn't even open an external file (today, you choose File > Open File). UNIX® users were lucky because they could emulate a flexible project structure using symbolic links, but Windows users didn't have such privileges. Today, Eclipse supports linked resources at the IDE level.

Linked resources in Eclipse behave much like UNIX symbolic links. For example, to add a large test input file to the project without copying it from its original location, choose File > New > File, and, in the window that opens, click Advanced . After they're added, linked resources are decorated with a small arrow over their icons