2

This is definitely a very beginner question that might not have to do anything with programming. After few days, I have finally identified the problem as for why I couldn't sign jar using jarsigner. I kept getting this error that says "jarsigner: unable to create hello.jar.sig".

Basically, what I did was to put a jar in Java jdk's bin folder and then I shift-left click there in the folder to click on "Open the command window here". I generated the key from keytool and also used selfcert. Then when I did the jarsigner for a jar already put in the bin folder, I got the error. I eventually figured out the reason. I couldn't create the jar.sig in the bin folder since I don't have sort of permission. The question is, how do I set the destination to some folder that is modifiable?

I have no idea how to set the path to java directory and calling jarsigner from desktop or elsewhere, so I had to learn to write command prompt right inside the java bin folder.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
user1142285
  • 119
  • 2
  • 10

1 Answers1

2
  1. Move your JAR file to a directory you can read/write.
  2. Run the original command: "C:\Path\To\JDK\bin\jarsigner" [options] jar-file

By default the output will be written to the directory you ran the command from.

In the long term, you can add the JDK bin directory to your Windows path.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254