What is the cause for the failure: “jarsigner: attempt to rename {file} to {file}.org failed” when signing jars with ant?

末鹿安然 提交于 2019-12-05 09:36:15

One possibility is that the jar - which is in a 'lib' directory - is on a classpath in use during your build. Is ${lib.dir} included on a classpath used in the buildfile?

You could create a separate directory to deposit signed jars to, and specify that to the 'signjar' task using the destdir attribute.

I had the same problem. Try renaming the jar file yourself. If it can't be renamed, you can usually figure out which application has a file lock on it. Most likely some instance of java. Quit all java-based apps and try again. (Use task manager to make sure your java/javaw are not running.) After that, it should work.

It looks for jarsigner.exe in the home directory of the JRE chosen for the project. If the JRE is just a JRE (not a JDK) this program will not be present.

Try setting a project-specific JRE and make sure it is actually a JDK.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!