Questions tagged [manifest.mf]

In software packaging, it is common to list the contents of a distribution in a manifest file

This file simply enumerates the files which are included in the distribution, either for processing by various packaging tools, or for human consumption.

The term is a loan from shipping, where a ship's manifest would list the crew or cargo of a vessel.

The manifest may optionally contain a cryptographic hash or checksum of each file. By creating a cryptographic signature for such a manifest file, the entire contents of the distribution package can be validated, as altering any of the files will invalidate the checksums in the manifest file.

The manifest files usually have .MF extension.

337 questions
3
votes
3 answers

Showing 'Failed to load Main-Class manifest attribute from TestExample.jar'

Failed to load Main-Class manifest attribute from TestExample.jar How to resolve the above problem of when I am trying to run the executable jar file?
3
votes
2 answers

Replacing the MANIFEST.MF file in a JAR programmatically

I want to modify the MANIFEST.MF after creating the JAR to exclude certain Class-Path entries. For this I decided to use zip4j. Extraction seems to work fine but for putting the MANIFEST.MF file back into the JAR, I use the following code: String…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
3
votes
0 answers

IntelliJ MANIFEST.MF cannot resolve main class

I'm attempting to create a jar for an RSA-based encryption program that I'm working on. The program itself is completely functional, and runs perfectly by running my main class, aptly named Main. However, when I attempt to use IntelliJ artifacts to…
Elie Hess
  • 63
  • 7
3
votes
3 answers

What Does "Export-Package: ." Mean?

Imagine an Eclipse plug-in (resp. OSGi bundle) with a package org.acme.foo.bar. It's possible to export "." e.g. see the following MANIFEST.MF snippet: Export-Package: ., org.acme.foo.bar Compiler has no problems with that so it seems to be a…
Marteng
  • 1,179
  • 13
  • 31
3
votes
1 answer

Preserving Manifest.mf when building via sbt assembly

When I build my project using sbt assembly, I get java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF. The solution that google recommends, is to use MergeStrategy.discard. That works in getting the project to build - but it crashes…
Ali
  • 261,656
  • 265
  • 575
  • 769
3
votes
1 answer

set Main-Class header with gradle from mainClassName

how do I get the jar task to set the Main-Class header from the mainClassName variable? thufir@dur:~/NetBeansProjects/props$ thufir@dur:~/NetBeansProjects/props$ gradle clean assembleDist;java -jar build/libs/props.jar BUILD SUCCESSFUL in 1s 6…
Thufir
  • 8,216
  • 28
  • 125
  • 273
3
votes
1 answer

What is the purpose of the ClassPath in the EAR's manifest file?

Within the context of a JEE EAR, I understand the purpose of the classpath entry in a WAR's Manifest.mf file as well as in an EJB's jar file. However, I do not understand the purpose in that of the EAR file. Is the EAR's classpath somehow supposed…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
3
votes
3 answers

How to read manifest.mf from POJO class (not a servlet) instantiated by spring?

I have a simple service called BuildNumberService which would be instantiated by spring. I'm trying to find the cleanest code for the class to find out the MANIFEST.MF file from the jar file it has been packaged into. The code has to run inside a…
David
  • 910
  • 1
  • 12
  • 22
3
votes
1 answer

Why CERT.SF file is need to verify an apk in android?

As we all know, MANIFEST.MF contains sha1-digest encoded in base64 for all the files in apk, CERT.SF contains sha1-digest of file MANIFEST.MF and all items in it, and CERT.RSA contains signature for file CERT.SF and a certification. Here is the…
expoter
  • 1,622
  • 17
  • 34
3
votes
2 answers

Java Manifest.mf classpath issues

I've been trying to run a jar file - let's call it test.jar - that uses the Sybase jconn3.jar on a Unix system. I have created a MANIFEST.MF file that has the following: Class-Path: $SYBASE/jConnect-6_0/classes/jconn3.jar commons-net-1.3.0.jar This…
Tim
3
votes
1 answer

Does the JAR entry point actually have to be inside the JAR?

A bit of context I am trying to design a minimal framework with a launcher which will be common to several projects. I am however encountering difficulties when it comes to running the JARs. My purpose is to have a self-sufficient java -jar command:…
Chop
  • 4,267
  • 5
  • 26
  • 58
3
votes
0 answers

How to add Variable path in MANIFEST file

I want to a add a path to my MANIFEST file, but this path is machine-dependent: one machine, the path may be C:\Program Files\Java\jre7\lib but it may be different on another machine. Is there some syntax for generalizing this path, so it can be…
Max Dy
  • 307
  • 3
  • 7
3
votes
1 answer

How to load a whole directory using Class-Path: jar manifest header?

If in the manifest for a jar file that needs to load non executable jars, I have the Class-Path: specification and then a directory holding the jars as the class path instead of a jar file. Will the manifest then load the whole directory or will it…
jgr208
  • 2,896
  • 9
  • 36
  • 64
3
votes
1 answer

Sign JAR without JRE but with OpenSSL?

Our system has Java and C parts. On the C side, we are signing certain data using command-line scripts calling OpenSSL commands. Now we want to sign some JARs too. We already have established PKI (what is important for this case - private keys are…
Konstantin Shemyak
  • 2,369
  • 5
  • 21
  • 41
3
votes
2 answers

Specify Manifest.MF during test - Fat / Shaded JAR

I have some values that I need to appear in a MANIFEST.MF file to keep JAI happy with ImageIO.read. Where do they need to exist to be available during the test phase of the maven cycle?
James Robinson
  • 1,222
  • 1
  • 15
  • 43