OVH Cloud OVH Cloud

modifier un manifest invalid header field

1 réponse
Avatar
yvon.thoravalNO-SPAM
j'ai un jar "tableview.jar" que je souhaite rendre double-clickable, il
y a déjà de dans :

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.1
Created-By: 1.4.2-34 ("Apple Computer, Inc.")
Main-Class: sbrunner.gui.tableView.TestTableView

et je voudrais ajouter le classpath par :

Class-Path: pg74jdbc3.jar yvonthor.jar

les deux autres jars dont dépend l'appli donc je me suis créé un fichier
"MANIFEST_ADDED.MF" avec la ligne ci-dessus, puis je fais :

jar umf lib/tableview.jar META-INF/MANIFEST_ADDED.MF

et ça me répond :
java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:383)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.update(Main.java:487)
at sun.tools.jar.Main.run(Main.java:167)
at sun.tools.jar.Main.main(Main.java:904)

à chaque fois que je lance cette commande je me retrouve avec un fichier
tmp29007.tmp vide dans le folder META-INF/...

kesako ???

Pourtant, cela correspond bien à ce qui est dit à la page :

http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html

soit :

Download extensions are specified in the Class-Path header field in the
manifest file of an applet, application, or another extension. A
Class-Path header might look like this, for example:
Class-Path: servlet.jar infobus.jar acme/beans.jar

With this header, the classes in the files servlet.jar, infobus.jar,
and acme/beans.jar will serve as extensions for purposes of the applet
or application. The URLs in the Class-Path header are given relative to
the URL of the JAR file of the applet or application.


Est-ce un pb de version ? Car j'ai :
Manifest-Version: 1.0

Si oui je la change de la même manière en "l'écrasant" l'ancienne valeur
ou faut-il que je modifie mon build.xml de ant ?
--
yt

1 réponse

Avatar
yvon.thoravalNO-SPAM
Yvon Thoraval wrote:

et je voudrais ajouter le classpath par :

Class-Path: pg74jdbc3.jar yvonthor.jar


Bon ben je l'ai fait, mais avec ant qui me donne bien :

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6beta3
Created-By: 1.4.2-34 ("Apple Computer, Inc.")
Main-Class: sbrunner.gui.tableView.TestTableView
Class-Path: pg74jdbc3.jar yvonthor.jar

???

(et mon appli est maintenant double-clickable)

alors...

le mêm build.xml n'a d'ailleurs pas marché avec ant 1.6.1 ...
--
yt