UnixNerd
UnixNerd

Reputation: 343

Java ServiceLoader can't find class

In the Jogamp Java3D Font3D class there is this piece of code

final ServiceLoader<GeometryService> gsLoader =
    ServiceLoader.load(GeometryService.class);

final Iterator<GeometryService> iter = gsLoader.iterator();
if (iter.hasNext()) return iter.next();

throw new IllegalStateException("No GeometryService implementation");

It works fine in Eclipse but when I package my work into a jar file it fails. I have no experience with this area of Java alas, I'd never even heard of ServiceLoader until a few days ago. How can I debug what's going on here. How can I tell where ServiceLoader is looking and why it can't find the class?

Upvotes: 0

Views: 46

Answers (0)

Related Questions