manifest.mf

Main-Class is not written to manifest of a jar

…衆ロ難τιáo~ 提交于 2021-02-10 17:59:29
问题 when I create a jar file from .class files with either: jar cmvf META-INF/MANIFEST.MF MyApp.jar *.class or jar cmvf manifest.mf MyApp.jar *.class despite a line with main class in the manifest file: Manifest-Version: 1.0 Created-By: 1.8.0_171 (Oracle Corporation) Main-Class: MainClassName I get an error when I start MyApp.jar java -jar MyApp.jar no main manifest attribute, in MyApp.jar when i unpack the jar (in some other folder) with: jar xf MyApp.jar the manifest looks like this: Manifest

Main-Class is not written to manifest of a jar

让人想犯罪 __ 提交于 2021-02-10 17:57:47
问题 when I create a jar file from .class files with either: jar cmvf META-INF/MANIFEST.MF MyApp.jar *.class or jar cmvf manifest.mf MyApp.jar *.class despite a line with main class in the manifest file: Manifest-Version: 1.0 Created-By: 1.8.0_171 (Oracle Corporation) Main-Class: MainClassName I get an error when I start MyApp.jar java -jar MyApp.jar no main manifest attribute, in MyApp.jar when i unpack the jar (in some other folder) with: jar xf MyApp.jar the manifest looks like this: Manifest

JAR Manifest file - Difference between Specification and Implementation

六眼飞鱼酱① 提交于 2020-08-22 08:09:11
问题 I want to add versioning information (and possibly some other metadata about the jar) to a jar of a library I created. However, I am not sure what attribute to use. I found that the specification as well the documentation explain that there can be a Specification-Version and an Implementation-Version (and a title and vendor for both). But neither properly explains what the difference between Specification and Implementation is. I also looked at different examples. The one from the

reading MANIFEST.MF file from jar file using JAVA

怎甘沉沦 提交于 2020-01-09 04:39:08
问题 Is there any way i can read the contents of a jar file. like i want to read the manifest file in order to find the creator of the jar file and version. Is there any way to achieve the same. 回答1: Next code should help: JarInputStream jarStream = new JarInputStream(stream); Manifest mf = jarStream.getManifest(); Exception handling is left for you :) 回答2: You could use something like this: public static String getManifestInfo() { Enumeration resEnum; try { resEnum = Thread.currentThread()

Java Security Exception BIRT and Apache POI Hack

社会主义新天地 提交于 2020-01-07 03:09:02
问题 I'm getting a java.lang.SecurityException: class "org.apache.poi.POIXMLDocument"'s signer information does not match signer information of other classes in the same package between the BIRT core jar and an Apache POI jar, as described by this BIRT bug report. It has been stated in the bug report that this can be fixed by upgrading BIRT, however when I do that I run into another runtime bug which can only be solved by downgrading. Thus, as it stands I am in a little bit of a pickle here. This

Missing Main-Class attibute in MANIFEST.MF in Maven generated jar file

守給你的承諾、 提交于 2020-01-05 21:21:03
问题 I am currently experimenting with Maven in Eclipse (m2e-Plugin) and tried to build and run the Hello World example project. However, when launching the generated jar, nothing happens. I checked the MANIFEST.MF and noticed that the Main-Class attribute was missing. After adding the attribute, the jar could be launched. Why does Maven not add this attribute? 回答1: Have a look at this link: https://maven.apache.org/shared/maven-archiver/examples/classpath.html#aAdd You can find there how to

How to add custom lines to MANIFEST.MF?

淺唱寂寞╮ 提交于 2020-01-02 05:15:09
问题 Adding custom key-value-pairs to the MANIFEST.MF using Build.scala seems not to work. Here is my code: import sbt._ import Keys._ import java.util.Date object Build extends Build { packageOptions in (Compile, packageBin) += Package.ManifestAttributes( "Build" -> "true" ) } When I add: packageOptions in (Compile, packageBin) += Package.ManifestAttributes( "Sign" -> "true" ) To my build.sbt then only Sign reaches my MANIFEST.MF. Any thoughts? 回答1: I think you may want something like this (note

Java Manifest.mf classpath issues

荒凉一梦 提交于 2019-12-30 10:30:12
问题 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 gives a ClassNotFoundError. $SYBASE is the system variable that points to /opt/sybase13; I've also tried the following: Class-Path: /opt/sybase13/jConnect-6_0/classes/jconn3.jar commons-net-1.3.0.jar and Class-Path: opt/sybase13/jConnect-6_0

How to include the lib folder in the manifest classpath in Netbeans

放肆的年华 提交于 2019-12-30 07:29:07
问题 A library that my java application uses needs looks for a file (log4j.xml) in the class path. I use netbeans to manage my project, but I can't find a way to include the lib/ folder. Netbeans automatically creates a MANIFEST.MF file inside the application jar and also creates a folder called lib/ which includes all dependencies. This manifest specifies a Class-Path attribute that overrides any -cp argument provided on the command line. I can select an arbitrary folder in netbeans' library

Unwrapping a java manifest file fin bash

大城市里の小女人 提交于 2019-12-25 07:40:49
问题 In Java, META-INF/MANIFEST.MF files have a maximum line length. Beyond that, an automatic line break is inserted, signaled by a space at the beginning of the next line, like so: Manifest-Version: 1.0 Export-Package: com.google.common.net;uses:="com.google.common.base,ja vax.annotation[file continues] Bundle-Name: Guava: Google Core Libraries for Java Unfortunately, this makes it painful to grep and sed in bash. How would you go about unwrapping it, using bash, into this? Manifest-Version: 1.0