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.