JDK-4482804 : Class-Path mangled in Manifest
  • Type: Bug
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.3.1
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2001-07-22
  • Updated: 2001-08-20
  • Resolved: 2001-08-20
Description

Name: boT120536			Date: 07/22/2001


java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)


1. create a jar file like this....

 jar cvfm app.jar our_manifest.mf *

The manifest file looks like...

<start>
Manifest-Version: 1.0
Main-Class: Main
Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar /lib/log4j.jar
/lib/referencedata.jar

<end>
*Note that all the entries for the Class-Path: attribute are on the same line.*

2. extract the manifest like this...

jar xvf app.jar META-INF/MANIFEST.MF

The manifest now looks like...
<start>
Manifest-Version: 1.0
Main-Class: Main
Created-By: 1.3.1 (Sun Microsystems Inc.)
Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar /lib/log4j.jar
  /lib/referencedata.jar

<end>

Note that the /lib/referencedata.jar entry is now on a line on its own.
 
The manifest file is now not valid.
(Review ID: 128114) 
======================================================================

Comments
WORK AROUND Name: boT120536 Date: 07/22/2001 No workaround found. Also happens on 1.4.0-beta-b65 ======================================================================
11-06-2004

PUBLIC COMMENTS Manifest-Version: 1.0 Main-Class: Main Created-By: 1.3.1 (Sun Microsystems Inc.) Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar /lib/log4j.jar /lib/referencedata.jar This is a complitely OK manifest file. Space at the beginning of a line means continuation of the previous line according to Manifest spec. When reading this manifest java.util.jar.Manifest will discard the space and concatenate two lines into one. Since Manifest can't have more then 72 characters in a line, jar tool automatically produces these continuations. If you do not want to have long lines , you could also do it like this Manifest-Version: 1.0 Main-Class: Main Created-By: 1.3.1 (Sun Microsystems Inc.) Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar Class-Path: /lib/log4j.jar /lib/referencedata.jar
10-06-2004

EVALUATION Manifest-Version: 1.0 Main-Class: Main Created-By: 1.3.1 (Sun Microsystems Inc.) Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar /lib/log4j.jar /lib/referencedata.jar This is a complitely OK manifest file. Space at the beginning of a line means continuation of the previous line according to Manifest spec. When reading this manifest java.util.jar.Manifest will discard the space and concatenate two lines into one. Since Manifest can't have more then 72 characters in a line, jar tool automatically produces these continuations. If you do not want to have long lines , you could also do it like this Manifest-Version: 1.0 Main-Class: Main Created-By: 1.3.1 (Sun Microsystems Inc.) Class-Path: /lib/utils.jar /lib/xmlutil.jar /lib/db.jar Class-Path: /lib/log4j.jar /lib/referencedata.jar ###@###.### 2001-08-20
20-08-2001