As many of you have probably noticed, scenarios which use the "UserInfo" facility don't work properly with Java 8. This is due to Java 8 having tighter restrictions on applets which prevent the scenarios from contacting the greenfoot.org server.
The Greenfoot team will hopefully be able to develop a reasonable solution for this in the long term. In the meantime, I have discovered the following workaround. This involves editing Java security policy and so carries a certain element of risk if you misconfigure the policy. However if you are confident that you know what you are doing then this will allow you to run scenarios which make use of UserInfo.
Step 1. Locate your deployment properties file.
This file controls various aspects of the behavior of Java. It can be found:
On Windows at - <User Application Data Folder>\LocalLow\Sun\Java\Deployment\deployment.properties
(such as \Users\Tabitha\AppData\LocalLow\Sun\Java\Deployment\deployment.properties)
On Linux at - ${user.home}/.java/deployment/deployment.properties
(where ${user.home} is normally your home directory, such as '/home/betty').
On Mac at - ~/Library/Application Support/Oracle/Java/Deployment/deployment.properties
(where '~' is your user folder, such as /Users/fred)
Step 2. Edit the deployment properties to enable the user policy settings
You need to open the deployment.properties file in a text editor, and add the following line at the bottom:
deployment.security.use.user.home.java.policy=true
Step 3. Locate or create your .java.policy file
Your .java.policy file (note the name begins with a dot!!) can be found:
Save the file, restart your browser, and you should be done.
- On Windows at - ${user.home}\.java.policy (Windows)
- On Linux at - ${user.home}/.java.policy
1 2 3 | permission java.net.SocketPermission "www.greenfoot.org:8888" , "connect, resolve" ; }; |