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?

[1494 byte] By [naansofta] at [2007-11-27 9:30:18]
# 1
You cannot judge if a system property is readable only by its meaning. Read the java.policy file in your jre/ lib/security to read a list of them.
wangwja at 2007-7-12 22:41:18 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

Yes, I understand that the policy file will tell me what properties I am allowed to access and not. In fact, the policy file do permit the reading of java.version (and even java.vm.version) but not - and this is where I wonder - the java.runtime.version property.

I merely ask, because of two things:

1) Several places (for example in this link: http://mindprod.com/jgloss/properties.html

- but also "Java in a NutShell", if I remember correctly) you will find that the java.runtime.version is mentioned as a property that can be accesses from unsigned applets

2) - And I want to have the best way of determine the Java runtime version that my user is using, when calling one of my applets (giving him the no-good if the version is a version, I don't like to support)

naansofta at 2007-7-12 22:41:18 > top of Java-index,Security,Other Security APIs, Tools, and Issues...