ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael B Allen <>
Subject pathelement triggers NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
Date Fri, 21 Oct 2011 20:58:32 GMT

I'm posting this to dev instead of users because my best guess is that
this is a bug. But hopefully I'm wrong.

Consider the following target which runs a Java program MakeFoo.class:

<target name="foo">
    <java classname="MakeFoo">
            <pathelement location="."/>
        <arg line="-o foo -d 'maken some foo'"/>

This generates the following exception:

$ ant foo
Buildfile: /some/path/to/build.xml

     [java] java.lang.NoClassDefFoundError:
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at
     [java]     at
     [java]     at java.lang.reflect.Method.invoke(
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java] Caused by: java.lang.NoClassDefFoundError:
     [java]     at java.lang.Class.forName0(Native Method)
     [java]     at java.lang.Class.forName(
     [java]     at
     [java]     ... 21 more
     [java] Caused by: java.lang.ClassNotFoundException:
     [java]     at
     [java]     at
     [java]     at
     [java]     at java.lang.ClassLoader.loadClass(
     [java]     ... 24 more
     [java] Java Result: -1

Java and Ant versions are pretty much the latest:

$ java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010

And I know from using strace that Ant is actually using Sun's Java and
not openjdk.

If I remove the pathelement directive, the build works.

The class is in
${JAVA_HOME}/lib/jsse.jar and that jar is present.

So it seems Ant does not load jsse.jar when using pathelement. Why?

I would appreciate it if someone has a work-around for me. I need to
specify a bunch of jars in the classpath using fileset and once I do
that I need to add '.' so that the program itself is in the classpath.
But once I do this pathement triggers the jsse.jar problem. And
obviously I don't want to add a jsse.jar dep in the build.xml. So I'm
stuck. Please help.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message