What is the reason for the refusal: "jarsigner: attempt to rename {file} to {file} .org failed" when signing banners with ant?

I get an error message:

[signjar] jarsigner: attempt to rename C: \ workspace \ line_editor \ Lib \ icon.jar to C: \ workspace \ line_editor \ Lib \ icon.jar.orig

when trying to self-sign a set of jars with ant inside Eclipse. The ant construct did a great job with this project and similar code in other projects. I made some small changes to the code and tried to rebuild and keep getting this error.

Here is the related ant target:

<target name="sign" depends="jar" description="Signs Jars"> <genkey keystore="myKeystore1" alias="something" storepass="somethingpass" dname="CN=Classification, OU=NAPA, O=GPC, C=US"/> <signjar keystore="myKeystore1" alias="something" storepass="somethingpass"> <fileset file="${web.dir}/${jar.name}" /> <fileset dir="${lib.dir}"> <include name="*.jar"/> </fileset> </signjar> </target> 

I deleted the project and pulled it out of our repository. Thus, it has the same default settings as other projects that this part does not fail. I looked at the .jar in the question and it was not only readable. I changed the name, and the following alphabetical .jar file also failed. There is no program in this folder that accesses .jars.

Any suggestions that cause?

+6
java ant jarsigner
source share
3 answers

One possibility is that the jar, which is in the lib directory, is on the class path that is used at build time. Is ${lib.dir} in the class path used in the assembly file?

You can create a separate directory for storing signed cans and specify this in the "signjar" task using the destdir attribute.

+7
source share

I had the same problem. Try renaming the jar file yourself. If it cannot be renamed, you can determine which application has a lock file on it. Most likely some kind of java instance. Close all Java applications and try again. (Use the task manager to make sure your java / javaw is not running.) After that, it should work.

+2
source share

He searches for jarsigner.exe in the JRE home directory selected for the project. If the JRE is just a JRE (not a JDK), this program will not be present.

Try installing the JRE for a specific project and make sure that it is actually a JDK.

0
source share

All Articles