Cressie176
asked on
Class-Path ignored in MANIFEST.MF
Hi,
I'm newish to Java and trying to get to grips with manifest files. I have written a java application which works perfectly providing I don't compile everything into a jar e.g.
Works with
java -cp .;./com.ibm.mq.jar;./jakar ta-regexp- 1.2.jar PafClient
Doesn't work with
java -jar PafClient.jar
The contents of my jar is
PafClient.class
PafVO.class
com.ibm.mq.jar
jakarta-regexp-1.2.jar
META-INF/MANIFEST.MF
The contents of my manifest file is
Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Main-Class: PafClient
Class-Path: com.ibm.mq.jar jakarta-regexp-1.2.jar
META-INF/MANIFEST.MF is all in caps
There is a blank line beneath Class-path
I am using JDK 1.3.1_03
Any help would be most appreciated as this is driving me nuts!!!
Steve
I'm newish to Java and trying to get to grips with manifest files. I have written a java application which works perfectly providing I don't compile everything into a jar e.g.
Works with
java -cp .;./com.ibm.mq.jar;./jakar
Doesn't work with
java -jar PafClient.jar
The contents of my jar is
PafClient.class
PafVO.class
com.ibm.mq.jar
jakarta-regexp-1.2.jar
META-INF/MANIFEST.MF
The contents of my manifest file is
Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Main-Class: PafClient
Class-Path: com.ibm.mq.jar jakarta-regexp-1.2.jar
META-INF/MANIFEST.MF is all in caps
There is a blank line beneath Class-path
I am using JDK 1.3.1_03
Any help would be most appreciated as this is driving me nuts!!!
Steve
What is the error message you are getting?
ASKER
Doh!
Exception in thread "main" java.lang.NoClassDefFoundE rror: com/ibm/mq/MQMD
Exception in thread "main" java.lang.NoClassDefFoundE
You are missing the MQMD class. Try the following:
java -cp .;./com.ibm.mq.jar;./jakar ta-regexp- 1.2.jar -jar PafClient.jar
and tell me what happens.
java -cp .;./com.ibm.mq.jar;./jakar
and tell me what happens.
ASKER
Works fine.
However this doesn't help me package the external jars into the PafClient.jar so I can deploy with a single file.
(Sorry if I'm jumping the gun)
However this doesn't help me package the external jars into the PafClient.jar so I can deploy with a single file.
(Sorry if I'm jumping the gun)
You can always unpack the external jar files and pack everything into a single jar.
ASKER
I thought of this, but I'd rather know how to do things properly. According to what I've read in the Manifest spec it should be possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not that your "mq.jar" file must be in the folder "com/ibm" which should be relative to the "PafClient.jar" file. If your PafClient.jar is under the /home/cressie176/classes then the mq.jar should be in the /home/cressie176/classes/c om/ibm/mq. jar and your jakarta-regexp-1.2.jar should be in the /home/cressie176/classes/ jakarta-regexp-1.2.jar
Thsi:
> Not
should be:
> Note
and this:
> /home/cressie176/classes/ jakarta-regexp-1.2.jar
should be:
> /home/cressie176/classes/j akarta-reg exp-1.2.ja r
(no space before jakarta).
> Not
should be:
> Note
and this:
> /home/cressie176/classes/ jakarta-regexp-1.2.jar
should be:
> /home/cressie176/classes/j
(no space before jakarta).
Cressie176:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept girionis' comment as answer.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jimmack
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Accept girionis' comment as answer.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jimmack
EE Cleanup Volunteer