Dec 07

Creating a test certificate and signing your jar just involves three simple commands. Following shows the commands needed to firstly create your test certificate and add the certificate (with an alias of myCertAlias) to a keystore (named myKeyStore).


keytool -genkey -keystore myKeyStore -alias myCertAlias
keytool -selfcert -keystore myKeyStore -alias myCertAlias

The above only needs to be done once.
You can then use the keystore to sign your jar using the following command.


jarsigner -keystore myKeyStore jarfile.jar myCertAlias

written by objects \\ tags: , , , , , ,

Mar 14

If you have code that needs to perform a privileged operation (eg. an applet accessing the local disk) then it needs to be done from trusted code. You can make code trusted by making the call from a privileged block as shown in the following example.


AccessController.doPrivileged(new PrivilegedAction() {
   public Object run() {
        // add your privileged code here
        return null;
   }
});

written by objects \\ tags: , , ,

Feb 04

First step is to load this page and check that the problem is not with your VM

http://www.java.com/en/download/help/testvm.xml

If the VM is ok then next step is to check the Java Console.
First turn on full console logging by pressing ‘5’ in the Java Console
Then load the applet and check contents of console firstly for errors loading the applet jars and classes, then check for exceptions starting the applet itself.

Still can’t work out the problem? Post a comment here, preferably with a url that we can use to load it and we’ll check it for you.

written by objects \\ tags: ,