This site requires JavaScript, please enable it in your browser!
Greenfoot back
davmac
davmac wrote ...

2014/12/9

UserInfo storage and Java 8

davmac davmac

2014/12/9

#
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:
  • On Windows at - ${user.home}\.java.policy (Windows)
  • On Linux at - ${user.home}/.java.policy
In both cases '${user.home}' is your user home folder, such as '/Users/Mike' on Windows or '/home/kylie' on linux. (Unsure where it's found on Mac - need to check). The file may not exist, in which case you need to create it. You should put enter the following in the file:
1
2
3
grant codeBase "http://www.greenfoot.org/-" {
  permission java.net.SocketPermission "www.greenfoot.org:8888", "connect, resolve";
};
Save the file, restart your browser, and you should be done.
tkiesel tkiesel

2016/5/20

#
It's been a year and a half on this one, so I know it's an old topic, but any news on this? The steps above aren't possible for my students and their locked-down limited user accounts on school-owned machines, and Java 7 isn't available for download or supported by Oracle anymore.
davmac davmac

2016/5/23

#
Unfortunately there's not much to report; for various reasons we've relegated UserInfo to the low-priority basket while working on other things over the past year or so (mainly, Greenfoot 3 and Stride). The other high-priority task right now is implementing a way to run Greenfoot scenarios on this website but without installing the Java applet plugin, which is no longer supported by most browsers. The latter task will probably mean re-working UserInfo anyway, but that's not going to happen quickly. Are you using UserInfo extensively? Could you give a brief run-down of how you (or how you would like to) use it in classes/exercises? I could take that to the team and we could discuss the possibility of putting someone to work on it sooner (though I don't want to make any promises).
You need to login to post a reply.