this tutorial serves to allow you to sign your own EJS applets.
- install latest JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. For example, Windows x86 for Windows XP operating system
- after installation, there should be C:\Program Files\Java\jdk1.7.0_45\bin where the keytool.exe is located.
- in order to run the cmd line keytool, add the PATH to include C:\Program Files\Java\jdk1.7.0_45\bin by going to Start , Settings, Control Panel
- Navigate to System, Environment Variables, Path Edit and add ;C:\Program Files\Java\jdk1.7.0_45\bin to the Variable value, so that the cmd line keytool avoid the error 'keytool' is not recognized as an internal or external command, operable program or batch file.
- Now, you are ready to go and type some lines by Naviagting to Start, Run
- type in cmd and press enter in the keyboard
- this will bring up a C:\WINDOWS\system32\cmd.exe console
- in order to save yourself some heavy typing, use the windows explorer to navigate to the folder where you saved all your jar files that you want signed. For example copy F:\Dropbox\Public\lookangEJSworkspace\export
- go to C:\WINDOWS\system32\cmd.exe console and do a right click and paste after you type cd F:\Dropbox\Public\lookangEJSworkspace\export
- to get cd F:\Dropbox\Public\lookangEJSworkspace\export and you need to type f: if you are using a different drive like me
- type keytool -genkey -keystore myKeystore -alias myAlias -validity 1800 , for my example my Alias is lookang, i recommend to keep myKeystore as it is and adding -validity 1800 for a 1800 days of certification instead of the default 6 months. i used keytool -genkey -keystore myKeystore -alias lookang -validity 1800
keytool -genkey -keystore myKeystore -alias lookang -validity 1800
- enter your own password, don't tell anyone this password and follow the instruction the best you see fit
- notice that a new file called myKeystore is generated in the folder F:\Dropbox\Public\lookangEJSworkspace\export
- u are now ready to sign all jar applets using that just created myKeystore. type or copy this jarsigner -keystore myKeystore myJar.jar myAlias but for my case i will type jarsigner -keystore myKeystore ejs_model_RocketTemplatewee.jar lookang . you need to replace myJar.jar with the name of the own *.jar files and the myAlias also need to replace to the myAlias you used, for my case lookang. When ask for the Passphrase, just key in your password you used in step 12.
jarsigner -keystore myKeystore ejs_model_RocketTemplatewee.jar lookang
- now, how do i create a *.bat to run all this command for my 100+ applets? leave a Google+ comment at the bottom of this post and tell how :) Enjoy!