I have finished a small game in Java and I want to upload it online. I have an HTML file that loads it properly, as well as the code being fine. However, I can't use the function

File file = new File(System.getenv("appdata") + "\\sniperscreed\\save.dat");

If I run it locally in Eclipse it works fine, but if I run it in a browser it says it needs my .jar file to be signed. After following many tutorials, I find that the only way to self-certify is to use these following commands:

keytool -genkey hello -alias HeyGuys
jarsigner "C:\my path\myJar.jar" myKeyName

None of this works, all it does is say that "keytool" is not a recognizable executable as well as the jarsigner. So I went into the Java JDK folder and copied the files, along with the jli.dll that's required, and now it gives me this:

http://i.stack.imgur.com/DZBof.png

Thanks.

有帮助吗?

解决方案

I found the answer out recently, pretty simple fix actually.

In order to fix the issue, you should have a global variable set to the actual JDK build folder, however I didn't do this. Making an absolute path to the executables works just as well (ex. instead of keysigner.exe, use C:\Program Files\Java\jdk1.7.0_21\bin\keytool).

I really hope this helps someone in the future.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top