ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael B Allen <>
Subject Re: pathelement triggers NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
Date Mon, 24 Oct 2011 05:22:30 GMT
On Sat, Oct 22, 2011 at 1:13 AM, Stefan Bodewig <> wrote:
> Hi Michael,
> On 2011-10-21, Michael B Allen wrote:
>> I'm posting this to dev instead of users because my best guess is that
>> this is a bug.
> Probably not.
>> Consider the following target which runs a Java program MakeFoo.class:
>> <target name="foo">
>>     <java classname="MakeFoo">
>>         <classpath>
>>             <pathelement location="."/>
>>         </classpath>
>>         <arg line="-o foo -d 'maken some foo'"/>
>>     </java>
>> </target>
>> This generates the following exception:
>> $ ant foo
>> Buildfile: /some/path/to/build.xml
>> foo:
>>      [java] java.lang.NoClassDefFoundError:
>> com/sun/net/ssl/internal/ssl/Provider
>>      [java]     at
> [...]
>>      [java] Java Result: -1
>> Java and Ant versions are pretty much the latest:
>> If I remove the pathelement directive, the build works.
> If you don't specify the <classpath> explicitly your Java process runs
> with the same CLASSPATH that is used by Ant internally - which includes
> jsse.jar.
> If you specify it, then you only get what you have asked for (unless you
> fiddle with the build.sysclasspath property), or close to it.  I think
> it should work if you explicitly add
> <pathelement path="${java.class.path}"/>

Hi Stefan,

Adding that pathelement had no effect. I still get precisely the same error.

I would argue that if pathelement requires jsse.jar, it should
automatically include it in the classpath just as it does rt.jar.

> if you don't like hardcoding jsse.jar (which you could address relative
> to ${java.home}).

I ended up just copying jsse.jar into my jars directory which is part
of the classpath using a fileset so that the issue would at least no
pollute my build.xml. Of course when I update Java this could break.
But I could not think of another way to do it.

Thanks anyway. I just posted for posterity mostly.


Michael B Allen
Java Active Directory Integration

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

View raw message