Getting the .jar correct with Ant, with proper main-class and class-path specified in the manifest file.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shanika_Weerapperuma
Posted On:   Wednesday, July 16, 2003 10:55 PM

Hi I am new to ant and trying to create the .jar unsuccessfully. (My configurations: win 2000, j2sdk version 1.4.0, ant version 1.5) The problem is that even though my .jar file gets created, when double click on the jar file to execute it, nothing works. When executed through the command prompt (java -jar x.jar), an exception is thrown (NoClassDefFound) I'm not too sure whether my manifest file is correct. I have the folowing entry in my manifest file: Main-Class: sroot.gui.LogIn Class-Path: srootjdbcmm.mysql-2.0.14-bin.jar xyz.jar srootprotomatterprotomatter-1.1.7.jar srootjdomjdom.jar srootmailactivation.jar srootmailmail.jar manifest="${build}/manifest.txt"/>    More>>

Hi

I am new to ant and trying to create the .jar unsuccessfully.

(My configurations: win 2000, j2sdk version 1.4.0, ant version 1.5)


The problem is that even though my .jar file gets created, when double click on the jar file to execute it, nothing works. When executed through the command prompt (java -jar x.jar), an exception is thrown (NoClassDefFound)


I'm not too sure whether my manifest file is correct. I have the folowing entry in my manifest file:




Main-Class: sroot.gui.LogIn

Class-Path: srootjdbcmm.mysql-2.0.14-bin.jar xyz.jar srootprotomatterprotomatter-1.1.7.jar srootjdomjdom.jar srootmailactivation.jar srootmailmail.jar





manifest="${build}/manifest.txt"/>

Can someone please help me to solve this?

Thanks in advance.

WKS

   <<Less

Re: Getting the .jar correct with Ant, with proper main-class and class-path specified in the manifest file.

Posted By:   Eugene_Kuleshov  
Posted On:   Thursday, July 17, 2003 12:13 PM

This is not related to Ant. As I can see your manifest has been included to jar as you like. So, the only problem you have is the classpath. So, make sure that your "current directory" have sroot dir inside and all the rest of jars are in the same dirs as you specified in your manifest file.
About | Sitemap | Contact