ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <nagendra.r...@tejasoft.com>
Subject Re: Access jar files in a library directory in the jar file
Date Tue, 18 Jun 2013 04:05:52 GMT
Hi,

http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

If you want to load classes inMyUtils.jarinto the class path for use 
inMyJar.jar. These two JAR files are in the same directory and can't be 
packaged within MyJar.jar

Regards,
Nagendra
*Raja Nagendra Kumar*
Founder & C.T.O 	
*Mobile:* +91-9886723872
	*Email:* nagendra.raja@tejasoft.com <mailto:nagendra.raja@tejasoft.com>
*IM:* nagendra.raja (Skype)
*http://in.linkedin.com/in/nagkumar*
	*TejaSoft Innovations Pvt Ltd*
<http://www.tejasoft.com>
Factor 4 Results

See who we know in common 
<http://www.linkedin.com/e/wwk/5094208/?hs=false&tok=0bfzEZotG8slI1> 
Want a signature like this? 
<http://www.linkedin.com/e/sig/5094208/?hs=false&tok=0uLVu92uq8slI1>


On 6/18/2013 4:38 AM, Joe Attardi wrote:
> Hi Rob,
>
> I don't think you can have JAR files inside the JAR file like that.
>
>
> On Mon, Jun 17, 2013 at 6:38 PM, Rob Tanner<caspersgrin@gmail.com>  wrote:
>
>> Hi,
>>
>> I'm trying to build a runnable jar file that includes several libraries
>> that are also jar files.  My problem is that Java does not seem to be able
>> to find the libraries.  I get this message when I try to run the jar file:
>>
>> java -jar LibraryAlmaInterface.jar
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/linfield/PreferencesManager/XMLPrefs
>>          at org.linfield.Library.PatronDataTransfer.<clinit>(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> org.linfield.PreferencesManager.XMLPrefs
>>          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>>          at java.security.AccessController.doPrivileged(Native Method)
>>          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>          ... 1 more
>>
>> You can see from the table of contents that the c;ass file is there:
>>
>> jar tf LibraryAlmaInterface.jar
>> META-INF/
>> META-INF/MANIFEST.MF
>> lib/
>> org/
>> org/linfield/
>> org/linfield/Library/
>> org/linfield/Library/Workers/
>> lib/jsch-0.1.49.jar
>> lib/linfield.jar
>> lib/log4j-1.2.15.jar
>> lib/xerces.jar
>> org/linfield/Library/CalculateBarcode.class
>> org/linfield/Library/PatronDataTransfer.class
>> org/linfield/Library/Workers/MyUserInfo.class
>> org/linfield/Library/Workers/PatronLoadsXML.class
>> org/linfield/Library/Workers/SecureFTPHandler.class
>>
>> And the linfield.jar contains the class that the loader can't find:
>>
>> META-INF/
>> META-INF/MANIFEST.MF
>> org/
>> org/linfield/
>> org/linfield/PreferencesManager/
>> org/linfield/PreferencesManager/PreferencesParser.class
>> org/linfield/PreferencesManager/XMLPrefs.class
>> org/linfield/PreferencesManager/XMLPrefs.java
>> org/linfield/PreferencesManager/PreferencesParser.java
>>
>> And the manifest in linfield.jar is:
>>
>> cat META-INF/MANIFEST.MF
>> Manifest-Version: 1.0
>> Created-By: 1.4.0 (Sun Microsystems Inc.)
>>
>> And most importantly, here is the main MANIFEST.MF file (for
>> LibraryAlmaInterface.jar):
>>
>> cat META-INF/MANIFEST.MF
>> Manifest-Version: 1.0
>> Ant-Version: Apache Ant 1.8.3
>> Created-By: 1.6.0_45-b06-451-11M4406 (Apple Inc.)
>> Built-By: rtanner
>> Main-Class: org.linfield.Library.PatronDataTransfer
>> Class-Path: lib/jsch-0.1.49.jar lib/linfield.jar lib/log4j-1.2.15.jar
>>   lib/xerces.jar
>>
>>
>> I'm assuming that the problem is with the manifest, but I have no idea
>> what it is.  Any help would be greatly appreciated.
>>
>> Thanks,
>>
>>
>> Rob Tanner
>> Linfield College
>>
>>
>>
>>
>>
>

Mime
View raw message