Skip to main content
clarify
Source Link
rogerdpack
  • 67.7k
  • 40
  • 290
  • 409

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

YouAssuming you're using ant, you can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

Assuming you're using ant, you can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in antit's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the futureerrors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

try to clarify why
Source Link
rogerdpack
  • 67.7k
  • 40
  • 290
  • 409

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signaturessignature files are still present, and no longer validmatch the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signaturessignature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signatures are no longer valid so the runtime halts.

You can solve the problem by eliminating the signatures from your jarfile dependencies. Unfortunately, it's not possible to do this in one step.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signature files are still present, and no longer match the "big combined" jarfile, so the runtime halts thinking the jar file has been tampered with (which it...has so to speak).

You can solve the problem by eliminating the signature files from your jarfile dependencies. Unfortunately, it's not possible to do this in one step in ant.

However, I was able to get this working with Ant in two steps, without specifically naming each jarfile dependency, by using:

<target name="jar" depends="compile" description="Create one big jarfile."> <jar jarfile="${output.dir}/deps.jar"> <zipgroupfileset dir="jars"> <include name="**/*.jar" /> </zipgroupfileset> </jar> <sleep seconds="1" /> <jar jarfile="${output.dir}/myjar.jar" basedir="${classes.dir}"> <zipfileset src="${output.dir}/deps.jar" excludes="META-INF/*.SF" /> <manifest> <attribute name="Main-Class" value="com.mycompany.MyMain" /> </manifest> </jar> </target> 

The sleep element is supposed to prevent errors about files with modification dates in the future.

Other variations I found in the linked threads didn't work for me.

Source Link
Rich Apodaca
  • 29.1k
  • 18
  • 108
  • 133
Loading