Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Simplify Eclipse classpaths using classpath containers

Aaron Tarter (aarontar@us.ibm.com), Advisory Software Engineer, IBM
Aaron Tarter
Aaron Tarter is an advisory software engineer working for the WebSphere Technology Institute in Research Triangle Park, N.C. He received a master's degree in computer networking from North Carolina State University in 2005. Recently, he has been developing incubator projects in the areas of Web 2.0 technology, business activity monitoring, and common event infrastructure.

Summary:  Eclipse classpath containers are an organized, user-friendly way to manage Java™ libraries in Eclipse. Since a group of libraries can be referenced as one abstract name, they can be removed and added as a single entry easily. The view of the libraries is also simplified in the Java Perspective as a single entry that can be expanded to view the entire set. Since the set of libraries is defined by an implementation of IClasspathContainer, it can be redefined dynamically. This tutorial shows how to implement a custom IClasspathContainer with accompanying extensions of classpathContainerInitializer and classpathContainerPage.

Date:  08 May 2007
Level:  Intermediate PDF:  A4 and Letter (517 KB | 30 pages)Get Adobe® Reader®

Activity:  61062 views
Comments:  

Before you start

About this tutorial

This tutorial focuses on Eclipse classpath container functionality. It starts by explaining some Eclipse classpath concepts, then guides you through the details of implementing a classpath container. You will create a simple Eclipse plug-in that provides an implementation of IClasspathContainer, and extends the classpathContainerIntializer and classpathContainerPage extension points to make the container accessible to the user. You will also implement a Java element filter to filter files included in the classpath container from the Java Package Explorer.


Objectives

In this tutorial, you will learn:

  • The basic concepts behind the Eclipse JDT classpath
  • How to implement IClasspathContainer
  • How to extend classpathContainerInitializer
  • How to extend classpathContainerPage
  • A method for filtering contained classpath entries from the Java Package Explorer, so they are not unintentionally added as duplicates

Prerequisites

This tutorial is written for Eclipse programmers whose skills and experience are at an intermediate level. It is expected that you understand the Eclipse Platform architecture, the basics of extending the platform, as well as Eclipse Java projects and how the classpath is used in those types of projects. The code uses some features that were new to Java 5, such as Generics. The usage is small, but it will help to have an understanding of Java 5 features.

System requirements

To run the examples, you need:

Eclipse V3.2 or later
Although you may have some success with earlier versions, the code in this tutorial was tested with Eclipse V3.2.2, which was the latest official release at the time of this writing.
JDK V1.5 or later, from IBM or Sun Microsystems
Some Java features new to version 5 are used in this tutorial to a very small degree, such as Annotations and Generics.

1 of 11 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source, Java technology
ArticleID=216776
TutorialTitle=Simplify Eclipse classpaths using classpath containers
publish-date=05082007
author1-email=aarontar@us.ibm.com
author1-email-cc=