Producing executable jar in NetBeans

I just had the same problem in NetBeans 7.2.1 with a Maven Java Application project. Modify the pom.xml file to include the maven assembly plugin with one tweak to myrho’s answer (needs to reference the predefined descriptor “jar-with-dependencies”): <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>your.app.MainClass</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> … Read more

Generate manifest class-path from in Ant

<path id=”build.classpath”> <fileset dir=”${basedir}”> <include name=”lib/*.jar”/> </fileset> </path> <pathconvert property=”manifest.classpath” pathsep=” “> <path refid=”build.classpath”/> <mapper> <chainedmapper> <flattenmapper/> <globmapper from=”*.jar” to=”lib/*.jar”/> </chainedmapper> </mapper> </pathconvert> <target depends=”compile” name=”buildjar”> <jar jarfile=”${basedir}/${test.jar}”> <fileset dir=”${build}” /> <manifest> <attribute name=”Main-Class” value=”com.mycompany.TestMain”/> <attribute name=”Class-Path” value=”${manifest.classpath}”/> </manifest> </jar> </target> For further information check out this article.

Can values defined in MANIFEST.MF be accessed programmatically?

Many of the values in the MANIFEST.MF can be accessed programmatically without having to find and/or open the jar file itself. The class java.lang.Package provides access to the ImplementationTitle, ImplementationVendor, ImplementationVersion, SpecificationTitle, SpecificationVendor and the SpecificationVersion. Information about signed classes can be found using the CodeSource class, which can be retrieved via Class.getProtectionDomain().getCodeSource()

Trying to UNINSTALL_SHORTCUT but shortcut won’t go away

DEPRECATED; KEPT SOLELY FOR HISTORICAL PURPOSES This answer was posted in 2014, when the described method relied on functionality that existed in most Android devices. However, as mentioned by Adrian-Costin Čšundrea, this functionality was removed a couple of years ago from Launcher3, which is the AOSP launcher upon which the Google Now Launcher is based1. … Read more

Java applet manifest – Allow all Caller-Allowable-Codebase

My findings are the same: This prevents warnings with Java 7u21 – 7u40: Manifest-Version: 1.0 Trusted-Library: true This exclusivly prevents warnings with Java 7u45: Manifest-Version: 1.0 Application-Library-Allowable-Codebase: * Caller-Allowable-Codebase: * Mixing both won’t work in 7u45. Now what? Did anyone find a way to allow SIGNED applets with “all-permissions” to run without warnings in both … Read more

DLL redirection using manifests

So it seems its impossible to redirect calls to LoadLibrary with absolute paths using manifests. After a lot of playing around with manifests, it seems that once you get past all the bad documentation manifests are actually stupidly simple. Basically when the executable is loaded windows collects all the related manifests that are linked using … Read more