Is there a way to set the system properties in an applet?

something like this:Properties p = System.getProperties();p.put("os.name", "Mac");System.setProperties(p);throws security exception...Thanks a million,Serano.
[214 byte] By [Serano12] at [2007-9-26 18:06:46]
# 1

you will have to give permission for the applet to read/write the system property. If you edit the java.polocy file in <jdk_home>\jre\lib\security\java.policy and add the line(s):

permission java.util.PropertyPermission "<SystemProperty>", "read";

permission java.util.PropertyPermission "<SystemProperty>", "write";

eg

permission java.util.PropertyPermission "os.name", "read";

permission java.util.PropertyPermission "os.name", "write";

You should now be able to set the properties in the applet.

/Br

Paul.

paulcarroll1 at 2007-7-3 1:47:55 > top of Java-index,Archived Forums,Java Programming...
# 2

you will have to give permission for the applet to read/write the system property. If you edit the java.polocy file in <jdk_home>\jre\lib\security\java.policy and add the line(s):

permission java.util.PropertyPermission "<SystemProperty>", "read";

permission java.util.PropertyPermission "<SystemProperty>", "write";

eg

permission java.util.PropertyPermission "os.name", "read";

permission java.util.PropertyPermission "os.name", "write";

You should now be able to set the properties in the applet.

/Br

Paul.s.name", "write";

You should now be able to set the properties in the applet.

/Br

Paul.

Brutus18 at 2007-7-3 1:47:55 > top of Java-index,Archived Forums,Java Programming...