Jar command not adding requested manifest file to archive

StephenBoesch

I am running the following - and the resulting MANIFEST.MF does not contain the one referenced below:

jar -cvf instrument.jar -m instrument/META-INF/MANIFEST.MF -C instrument .

Here is the intended MANIFEST.MF:

18:23:20/shared $ll instrument/META-INF/MANIFEST.MF
-rw-r--r--  1 steve  staff  33 Mar 31 17:57 instrument/META-INF/MANIFEST.MF

Here is the resulting jar file (notice incorrect date/size of MANIFEST.MF)

18:34:02/shared $jar -tvf instrument.jar
     0 Tue Mar 31 17:58:58 PDT 2015 META-INF/
    68 Tue Mar 31 17:58:58 PDT 2015 META-INF/MANIFEST.MF
   544 Tue Mar 31 17:56:42 PDT 2015 ObjectSizeFetcher.cl

Here are contents of the intended manifest:

18:36:39/shared $cat instrument/META-INF/MANIFEST.MF
Premain-Class: ObjectSizeFetcher

Here are actual contents inside the jar file:

8:35:38/x2 $cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.7.0_25 (Oracle Corporation)
Dima

You have to list all the options, except -C first, then the arguments (yeah, I know, original :)) and also provide the list of files to include

jar -cvfm instrument.jar instrument/META-INF/MANIFEST.MF -C instrument .

should do what you want.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Failing to run jar file from command line: “no main manifest attribute”

From Dev

Adding binary file to archive

From Dev

Access to file from jar archive

From Dev

Write a file into Java archive (JAR)

From Dev

Confusion on Uses of Jar Manifest File

From Dev

Adding external dependencies to a jar file through the command line

From Dev

adding jar file dependencies

From Dev

no main manifest attribute (But I have the manifest file in the jar)

From Dev

Exporting Jar file with Manifest attribute in Android Studio?

From Java

Replacing the MANIFEST.MF file in a JAR programmatically

From Dev

Using Java to read a .jar manifest file

From Dev

JAR Manifest file - Difference between Specification and Implementation

From Dev

JAR file manifest does not contain permission attribute

From Dev

Using Java to read a .jar manifest file

From Dev

add manifest to compiled exe file from jar

From Dev

"-includeresource" in JAR Manifest inside Gradle build file

From Dev

Adding properties to manifest file with spring boot

From Dev

"invalid CEN header (bad signature)" when extracting a 4GB+ file from a zip archive using Java 8 jar command

From Dev

Error opening zip file or JAR manifest missing : jrebel.jar

From Dev

Adding a JAR file to Python Script

From Dev

Adding jar file to instrumentation path

From Dev

Adding jar file to instrumentation path

From Dev

Adding jar file to add class in a java project using ant command line

From Dev

java.lang.SecurityException: JAR manifest requested to run in all-permissons only

From Dev

Making manifest file in java by command prompt

From Dev

How to configure a manifest file of a jar file by using the maven assembly plugin?

From Dev

Adding Loop in the File Command Python

From Dev

Loading Fonts from Jar while writing PDF-A (archive) file

From Dev

How to create a Java archive (.jar) file using NetBeans IDE 8.2

Related Related

  1. 1

    Failing to run jar file from command line: “no main manifest attribute”

  2. 2

    Adding binary file to archive

  3. 3

    Access to file from jar archive

  4. 4

    Write a file into Java archive (JAR)

  5. 5

    Confusion on Uses of Jar Manifest File

  6. 6

    Adding external dependencies to a jar file through the command line

  7. 7

    adding jar file dependencies

  8. 8

    no main manifest attribute (But I have the manifest file in the jar)

  9. 9

    Exporting Jar file with Manifest attribute in Android Studio?

  10. 10

    Replacing the MANIFEST.MF file in a JAR programmatically

  11. 11

    Using Java to read a .jar manifest file

  12. 12

    JAR Manifest file - Difference between Specification and Implementation

  13. 13

    JAR file manifest does not contain permission attribute

  14. 14

    Using Java to read a .jar manifest file

  15. 15

    add manifest to compiled exe file from jar

  16. 16

    "-includeresource" in JAR Manifest inside Gradle build file

  17. 17

    Adding properties to manifest file with spring boot

  18. 18

    "invalid CEN header (bad signature)" when extracting a 4GB+ file from a zip archive using Java 8 jar command

  19. 19

    Error opening zip file or JAR manifest missing : jrebel.jar

  20. 20

    Adding a JAR file to Python Script

  21. 21

    Adding jar file to instrumentation path

  22. 22

    Adding jar file to instrumentation path

  23. 23

    Adding jar file to add class in a java project using ant command line

  24. 24

    java.lang.SecurityException: JAR manifest requested to run in all-permissons only

  25. 25

    Making manifest file in java by command prompt

  26. 26

    How to configure a manifest file of a jar file by using the maven assembly plugin?

  27. 27

    Adding Loop in the File Command Python

  28. 28

    Loading Fonts from Jar while writing PDF-A (archive) file

  29. 29

    How to create a Java archive (.jar) file using NetBeans IDE 8.2

HotTag

Archive