?
Solved

Class-Path ignored in MANIFEST.MF

Posted on 2003-03-18
12
Medium Priority
?
759 Views
Last Modified: 2007-12-19
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;./jakarta-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

0
Comment
Question by:Cressie176
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 8160366
 What is the error message you are getting?
0
 

Author Comment

by:Cressie176
ID: 8160399
Doh!

Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/MQMD
0
 
LVL 35

Expert Comment

by:girionis
ID: 8160452
 You are missing the MQMD class. Try the following:

  java -cp .;./com.ibm.mq.jar;./jakarta-regexp-1.2.jar -jar PafClient.jar

  and tell me what happens.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Cressie176
ID: 8160530
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)
0
 
LVL 35

Expert Comment

by:girionis
ID: 8160593
 You can always unpack the external jar files and pack everything into a single jar.
0
 

Author Comment

by:Cressie176
ID: 8160647
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.
0
 
LVL 35

Accepted Solution

by:
girionis earned 300 total points
ID: 8160707
 Ok then in your manifest file change this line:

Class-Path: com.ibm.mq.jar jakarta-regexp-1.2.jar

  to this:

Class-Path: com/ibm/mq.jar jakarta-regexp-1.2.jar

  and tell me what happens.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8160726
 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/com/ibm/mq.jar and your  jakarta-regexp-1.2.jar should be in the /home/cressie176/classes/ jakarta-regexp-1.2.jar
0
 
LVL 35

Expert Comment

by:girionis
ID: 8160732
 Thsi:

> Not

  should be:

> Note

  and this:

>  /home/cressie176/classes/ jakarta-regexp-1.2.jar

  should be:

>  /home/cressie176/classes/jakarta-regexp-1.2.jar

  (no space before jakarta).
0
 

Expert Comment

by:CleanupPing
ID: 9058616
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.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9727112
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question