As per my current understanding, you cannot refer any third party utility Jars which you placed in your apps /lib folder, when you export it as a Jar.Say yourJar.jar has lib/log4j.jar. But your main class cannot load the log4j classes
The workaround for this situation: Place those utility/thrid party Jars in the same directory or inner directories, where your Jar is placed and making sure that that relative path is mentioned in the Manifest.mf Class-path Header.
<!-- This build script will help you build your own Jar, with utility Jars exported with
and all those Jars added to the MANIFEST.mf Class-Path header
<projectname="buildJar" default="build-jar" basedir=".">
>jar -xf MyJar.jar lib
--><!-- To take out just the lib/ directory jars out to the same directory as this JAR use below command</project>