Thanks for all reply. Now what I did is I compiled only one source file and made a jar out of it which contains only one ArrayExample.class file. Once JAR available then I unzipped that JAR and edited the manifest file as per your suggestion but still I am getting same error.
Please find the attached java source file and manifest file. Please help Regards Irfan. -----Original Message----- From: Taj, Abdul [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2008 6:23 PM To: Ant Users List Subject: RE: unable to execute JAR file Does the jar have a manifest file that specifies the main class that needs to be executed when you execute it? When you create a jar it will have a META-INF directory inside which you need to place a manifest file that has the main class that needs to be executed when you execute the jar file. Just google about the manifest file and you will get your answer -t ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2008 3:26 AM To: user@ant.apache.org Subject: unable to execute JAR file Hi All, I have 10 java files and I have written Ant build.xml to compile and create JAR file which contains the .class files. Now my requirement is that I need to execute/install the JAR file but unfortunately I can't do this as I am getting following error. D:\Irfan\Manvendra Singh java code\Manvendra Singh java code>java -jar test.jar Failed to load Main-Class manifest attribute from test.jar D:\Irfan\Manvendra Singh java code\Manvendra Singh java code> Please find the attached java code and build script. Please help Regards Irfan. -------------------------------------------------------- The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message. --------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]