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

2013/4/18

Problem running Greenfoot JDK 7u21 (and Solution!)

1
2
davmac davmac

2013/4/18

#
Update 29/4/13: This problem should be fixed with the just-released Greenfoot 2.3.0. ------ We have discovered an issue with the just-released Java update, JDK 7u21 (and 6u45). There is a change to the default value of a system property in this JDK update which prevents Greenfoot from starting, and causes it to produce the following error message: Greenfoot failed to launch. For help go to http://greenfoot.org/support/index.html We will address this problem for the next Greenfoot release. In the meantime we have the following workaround: For Windows: You'll need to edit the 'bluej.defs' file that can be found in the "lib" folder, just inside the Greenfoot folder (wherever Greenfoot was installed). You can edit this file using Notepad (but see below). Find the line which reads: #bluej.windows.vm.args= And change it to: bluej.windows.vm.args=-Djava.rmi.server.useCodebaseOnly=false Make sure to remove the '#' at the beginning! Then save the file, noting the following:
  • You will most likely not be able to save it to the original location as writing files within "Program Files" requires administrator privileges - instead, you should save the file somewhere else (such as into your "Documents" folder), and then copy the new version over the original using Windows explorer.
  • Be wary that after saving the file to a new location, Notepad may append ".txt" to the file name (so that it becomes "bluej.defs.txt". The ".txt" extension might not be visible in Windows Explorer, however, you will need to remove the ".txt" before copying it back to the original location. This page explains how to make filename extensions visible (in Windows 7 - use a web search if necessary to find instructions for other Windows versions), at which point you can then rename the file and remove the ".txt" suffix.
An alternative option is to run Greenfoot using a slightly older JDK (eg JDK 7u17). You can run the "select VM" utility included with Greenfoot to choose which of the installed JDKs to run Greenfoot with. The "select VM" utility can be accessed via the Start menu. For Mac OS: From the Finder, Control-click the Greenfoot application, and select "show package contents". Navigate into the "Contents" subfolder, control-click the "Info.plist" file and choose "open with" - "other", select the TextEdit application from the Applications folder. Fine the part which looks like this (near the bottom): <key>Properties</key> <dict/> Remove the '<dict/>' line and replace it with the following: <dict> <key>java.rmi.server.useCodebaseOnly</key> <string>false</string> </dict> Be careful! If you get it wrong you may prevent Greenfoot from starting at all. For Debian/Ubuntu: You need to edit the greenfoot launch script using a suitable text editor. Only the root user can edit the file, so you may need to use 'sudo' or 'su' to become root. For example, run the following command in the terminal: sudo pico /usr/bin/greenfoot This will use the 'pico' editor. You will be prompted for your password; this assumes you have sudo privileges. Find the line which looks like this: "$JAVAPATH/bin/java" -Dawt.useSystemAAFontSettings=on -cp "$CP" bluej.Boot \ And change it to: "$JAVAPATH/bin/java" -Djava.rmi.server.useCodebaseOnly=false -Dawt.useSystemAAFontSettings=on -cp "$CP" bluej.Boot \ (Still on a single line!). For other systems (where the "generic" installer was used): In the location where you installed Greenfoot, you will need to edit the "greenfoot" launch script. Find the line which says: "$JAVAPATH/bin/java" -cp "$CP" bluej.Boot -greenfoot=true -bluej.compiler.showunchecked=false "$@" And change it to: "$JAVAPATH/bin/java" -Djava.rmi.server.useCodebaseOnly=false -cp "$CP" bluej.Boot -greenfoot=true -bluej.compiler.showunchecked=false "$@"
JetLennit JetLennit

2013/4/18

#
Mine seems to be working just fine...
davmac davmac

2013/4/18

#
Are you actually running with JDK 7u21? What does your "About Greenfoot" dialog show?
JetLennit JetLennit

2013/4/18

#
I just updated java today, and "About Greenfoot"?
JetLennit JetLennit

2013/4/18

#
Wait... never mind i hadn't updated it evidentally
davmac davmac

2013/4/18

#
Yeah. "Help", "About Greenfoot". You say you updated Java, but are you running Greenfoot with the new Java version or still with the old one?
JetLennit JetLennit

2013/4/18

#
It is 1.7.0_6... nut i just updated to 1.7.0_7?
davmac davmac

2013/4/18

#
Read the original post. Re "select VM".
bourne bourne

2013/4/18

#
Is there a mac equivalent of select VM? Mine says it's still using java version 1.6.0_45
davmac davmac

2013/4/18

#
Is there a mac equivalent of select VM?
There is not. The next release of Greenfoot will allow running with JDK 7 (it will include a bundled JDK 7).
Game/maniac Game/maniac

2013/4/18

#
When will the next release be out
davmac davmac

2013/4/18

#
When it's ready. It should be soon.
Game/maniac Game/maniac

2013/4/18

#
Cool
sa7toot sa7toot

2013/4/20

#
Hi, I just installed Greenfoot and necessary JDK. I got the same error above, and was trying to fix it. However, I couldn't find the Bluej.defs neither in the greenfoot folder nor anywhere else. I am running Windows XP and followed the same instructions above. Your kind help is appreciated. BJ
mjrb4 mjrb4

2013/4/20

#
Hi, it should normally be in a folder like "C:\Program Files\Greenfoot\lib" on Windows - have you checked there?
There are more replies on the next page.
1
2