Do you use Java projects?

Have you ever checked out a Java project and wondered what jars are required in the build path? How do you manage the classpath of you Eclipse projects? Do you still add jars manually? Do you use classpath variables? STOP! Use PDE projects!

Even if you don’t develop OSGi bundles. It’s so convenient to let PDE manage your classpath. Their classpath container driven by the manifest takes away all the pain. You can even ensure proper API usage across the layers/components by defining what packages are internal and what not.

See here for the necessary steps. Actually there are just two. Convert you Java project into a Plug-in project and edit the manifest. šŸ™‚

2 thoughts on “Do you use Java projects?

  1. To be honest, you’ve been able to do this with Maven since it started. And, unlike PDE, Maven will actually go and get your dependencies for you from the repository, unlike PDE, which will complain about missing projects and force you to create plugins from existing Jars …

    Apparently, I’m a Maven enthusiast, so I should know šŸ™‚

    But seriously; you have a good point. It is convenient letting something else manage the classpath for you. It’s even better if you’re using features to make sure you don’t accidentally use a hidden package, even if you end up deploying it via Jars.

    But realistically, managing something by editing one file (manifest.mf) isn’t that different from editing another file (.classpath). Both can be shared by version control systems, and in any large project, you generally have one (or a small number of people) managing these dependencies for the entire team.

    The question is; what’s the cost/benefit of doing this? The cost is that people have to learn a new way of managing things that (realistically) only works in Eclipse. The benefit is … well, you edit one file instead of another?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.