The services mechanism was added to the JAR spec in JDK 1.3 or 1.4; Sun didn't add public classes to use services until JDK 6. Before JDK 6 you either had to use sun.misc.Service or write your own loader; IIRC there was also a loader available with one of the optional JDK extensions (something to do with audio or graphics) that we could use (it wasn't actually related to the function of the library that it was provided with).

For my DiagnosticsProvider/VersionProvider patch I wrote a ServiceLoader class that mimics the API of the supported ServiceLoader class that comes with JDK 6. I'm still trying to get that patch cleared through IBM legal though, so I have no idea when I would be able to complete the contribution.
Jeffrey E. (Jeff) Care
IBM WebSphere Application Server
WAS Release Engineering

WebSphere Mosiac
WebSphere Brandmark

From: "Xavier Hanin" <>
To: "Ant Developers List" <>
Date: 10/30/2008 09:02 AM
Subject: Re: ProjectHelper

On Thu, Oct 30, 2008 at 1:01 PM, Stefan Bodewig <> wrote:

> On Wed, 29 Oct 2008, Matt Benson <> wrote:
> --- Stefan Bodewig <> wrote:
> > Okay, what say we move the Project instantiation to
> > ProjectHelper then, so that custom ProjectHelpers can
> > influence the Project class used if needed?
> we probably can do so without breaking existing code.
> > This still doesn't alleviate the problem that EasyAnt will need a
> > little custom configuration to install the ProjectHelper and,
> > probably, an Executor.
> As for the ProjectHelper, there is a services facility, so all it
> takes is putting the correct services entry into META-INF/services
> (JavaFront does so) and keeping the jar in your classpath.

AFAIK this only works with Java 6.