Applets: Why the difference in java.version vs. java.runtime.version
I wonder why this is so:
Given the following simple applet code running asuntrusted:
import java.applet.*;
import java.awt.*;
publicclass testVersionextends Applet{
publicvoid init(){
try{
this.add(new Label("Version: "+System.getProperty("java.runtime.version" ) ) );
}
catch (java.security.AccessControlException e){
System.out.println( e.toString() );
}
}
}
The code drops into the exception and returns the result:
java.security.AccessControlException: access denied (java.util.PropertyPermission java.runtime.version read)
Using the property "java.version" instead of "java.runtime.version" will actually produce a result (for this case it is version1.4.2_10).
So: Why am I allowed to get the version using one method whereas the other throws a security exception?

