Problem with manifest / XP

Posted on 2003-03-04
Medium Priority
Last Modified: 2012-05-04
I have an ant build script that builds jar files (among other things) and it works fine on Linux and W2K, but when I try to run it from a XP machine, it says:

[jar] Manifest is invalid: Manifest sections should start with a "Name" attribute and not "Class-Path"

I'm running the same versions on all machines, java 1.3.1 and ant 1.4.1.

Does the ant task work differently on XP?
Question by:khbh
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
  • 4
  • 3
  • 2
  • +2
LVL 92

Expert Comment

ID: 8069892
Very strange.
Try changing the end of line seperator used in your manfiest file.
LVL 14

Expert Comment

by:Tommy Braas
ID: 8069967
Could you post a copy of the manifest?

Author Comment

ID: 8070310
OK, after further investigation I've noticed that a $-sign has mysteriously disappeared before the Class-Path statement in the build.xml file. Hmm, the file is still checked in in ClearCase and the XP computer has a view created through the ClearCase's web interface, the other machines has not. The build.xml file contains other $-signs that seems to work but they aren't inside an echo statement. Anyhow, I will add the $-sign and hopefully this will solve the problem. I'll let you know. Thanks anyway for your comments.
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more


Author Comment

ID: 8070672
OK (again), after another investigation there should be no $-sign before the Class-Path statement, so I think we're back to square one. Then it seems like it's the ant task behaves differently on the platforms. On linux/W2K it adds

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.4.1
Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)

to my created manifest (in the beginning of the file) when jarring it. Therefore it works.

I've seen that one can use the manifest statement in ant. I will try that out.

Thanks once more.
LVL 92

Accepted Solution

objects earned 400 total points
ID: 8074860
So you don't currently supply a manifest? Is that correct.

if so what does the manifest generated by xp look like?


Author Comment

ID: 8078135
I supply this manifest file (created by echo statements since we're running 1.4.1 and can't use the manifest statement) to the jar ant task:

Main-Class: my.testclass.Main

Class-Path: . jars\ichannel.jar jars\jsse.jar jars\jakarta-regexp-1.2.jar jars\log4j.jar jars\koala.jar jars\conc.jar jars\jcert.jar jars\jaxp.jar jars\jnet.jar jars\xerces.jar jars\myapp.jar file:///c:\orbacus\lib\OB.jar file:///c:\orbacus\lib\OBBalancer.jar file:///c:\orbacus\lib\OBBiDir.jar file:///c:\orbacus\lib\OBEvent.jar file:///c:\orbacus\lib\OBIMR.jar file:///c:\orbacus\lib\OBNaming.jar file:///c:\orbacus\lib\OBProperty.jar file:///c:\orbacus\lib\OBTest.jar file:///c:\orbacus\lib\OBTime.jar file:///c:\orbacus\lib\OBUDP.jar file:///c:\orbacus\lib\OBUtil.jar file:///c:\orbacus\lib\OBWatson.jar

and on linux/W2K the manifest file in the created jar file has the following lines added at the top:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.4.1
Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)

This is not the case with XP. The jar task complains about the supplied manifest file so it seems like it doesn't add the lines above.

I've also tested with ant 1.5.2.
LVL 92

Expert Comment

ID: 8078178
Did u try changing the eol character used as I suggested above?

Expert Comment

ID: 9058918
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 
Post your closing recommendations!  No comment means you don't care.

Author Comment

ID: 9067309
Yes, it didn't change anything :(
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 400 total points
ID: 9076236
I noticed that there's an awful lot of colons in the paths above. Might I suggest replacing path separating colons with semicolons, and "file:///c:" with "file:///c|" and all backslashes with forward slashes.

I hope this helps!

LVL 35

Expert Comment

ID: 9762199
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:

Split between objects and orangehead911.

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

762 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