APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Singning EJS applet post and replies

Return to the Singning EJS applet thread
Login to post to this thread

How can I sign an applet made with EJS
Diego Racero
11 Posts

I´m working with remote a lab that need  to connect through internet to an Arduino board and IP cammera.
I tried the applet and everything went fine, but when I tried to put it to work with the EJS pluggin within Moodle I received an error.
I found that the error arise just because I haven't signed my applet, but I don't know how to do that in EJS.

Could someone help me?

Thanks in advance

Replies to How can I sign an applet made with EJS

Re: How can I sign an applet made with EJS -
Francisco Esquembre
232 Posts


EJS cannot do this for you. You need to do it "by hand" once you have exported the jar file.

To learn how to do it, google for "how to sign a java applet". You will find plenty of places with the (relatively simple) procedure.


Re: How can I sign an applet made with EJS -
Julia Branke
11 Posts

I do not think, you can sign an applet with ejs.

You either have to buy a signer certificate or self sign your applet.

For selfsigning you can use the following commands:

To generate a key:

keytool -genkey -alias yourkeytext -keystore yourkeydirectory/yourkeytext -keypass choosepassword
keytool -selfcert -alias yourkeytext -keystore yourkeydirectory/yourkeytext

to sign

jarsigner -keystore yourkeydirectory/yourkeytext -signedJar simulation.signed.jar simulation.jar yourkeytext

If you selfsign the applet java tries to scare of the user, I believe that they plan not to allow self signing in near future.


Re: Re: How can I sign an applet made with EJS -
lookang Avatar
230 Posts
  1. full tutorial here http://weelookang.blogspot.sg/2013/11/how-to-sign-jar-files-for-web.html
  2. Now, you are ready to go and type some lines by Naviagting to Start, Run 
  3. type in cmd and press enter in the keyboard 
  4. this will bring up a C:\WINDOWS\system32\cmd.exe console
  5. 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
  6.  go to  C:\WINDOWS\system32\cmd.exe console and do a right click and paste after you type cd  F:\Dropbox\Public\lookangEJSworkspace\export 
  7. to get cd  F:\Dropbox\Public\lookangEJSworkspace\export and you need to type f: if you are using a different drive like me 
    cd F:\Dropbox\Public\lookangEJSworkspace\export  f:
  8. 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
  9. enter your own password, don't tell anyone this password and follow the instruction the best you see fit  
  10. notice that a new file called myKeystore is generated in the folder F:\Dropbox\Public\lookangEJSworkspace\export 
  11. 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 9.
    jarsigner -keystore myKeystore ejs_model_RocketTemplatewee.jar lookang
  12. 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! 
    1. full tutorial here http://weelookang.blogspot.sg/2013/11/how-to-sign-jar-files-for-web.html

Post edited November 21, 2013 at 11:30 PM EST.

Post edited November 21, 2013 at 11:34 PM EST.

OSP@SG blog
OSP@SG Digital Library

Re: How can I sign an applet made with EJS -
Luis de la Torre
4 Posts

I know this is an old thread but I have just found it.

Since you are uploading the EJS application to Moodle, I guess you are using the EJSApp plugin. This plugin has an option (since versión 1.7) to automatically sign every applet you upload to Moodle using the EJSApp activity.

Of course, you would need the sign certificate to be in your Moodle server. But trust me, this saves A LOT of time.

OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book