How to install greenfoot in Ubuntu 12.10

Asked by Edmond Condillac

It would be most appreciated if you would kindly advise how to launch Greenfoot from Dash Home, if possible please.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Edmond Condillac
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

How did you install it?

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

As far as I can see from the documentation. you start that program with

/usr/bin/greenfoot

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#3

Please also send us the output of this Terminal command:

cat /etc/lsb-release; uname -a; apt-cache search greenfoot; apt-cache show greenfoot; which java; java -version

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

ALso the outputr of:

file /usr/bin/greenfoot

Thanks

Revision history for this message
Edmond Condillac (econ22) said :
#5

On 14/11/13 07:56, actionparsnip wrote:
> Your question #239198 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/239198
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> How did you install it?
>
The download is available from http://www.greenfoot.org/door. There is a
link on that page offering the Greenfoot download to run on Linux.
After clicking on the link for this software, I selected the package for
Ubuntu, which supports Debian Then I saved the file greenfoot-230.deb
(64 MB) file in my /home/username folder. Then I right clicked on the
file name and chose to extract into the Downloads folder. However,
clicking on the icon for Greenfoot does not run the required Greenfoot
program. I've even tried right clicking the Greenfoot icon in Dash to
launch Greenfoot, but to no avail.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#6

Please also answer the questions in posts #2, #3 and #4.

Revision history for this message
Edmond Condillac (econ22) said :
#7

On 14/11/13 08:56, Mark Rijckenberg wrote:
> Your question #239198 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/239198
>
> Mark Rijckenberg requested more information:
> Please also send us the output of this Terminal command:
>
> cat /etc/lsb-release; uname -a; apt-cache search greenfoot; apt-cache
> show greenfoot; which java; java -version
>
Thanks for looking into this query. The output for the required
commands run is as follows:

mond@eME732:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"

mond@eME732:~$ uname -a
Linux eME732 3.5.0-42-generic #65-Ubuntu SMP Tue Oct 1 21:38:59 UTC 2013
i686 i686 i686 GNU/Linux

mond@eME732:~$ apt-cache search greenfoot
greenfoot - A simple but powerful Java IDE.

mond@eME732:~$ apt-cache show greenfoot
Package: greenfoot
Status: install ok installed
Priority: extra
Section: Programming
Installed-Size: 10000
Maintainer: Davin McCall <email address hidden>
Architecture: all
Version: 2.3.0
Depends: sun-java6-jdk | sun-java7-jdk | openjdk-6-jdk | openjdk-7-jdk
Description: A simple but powerful Java IDE.
   Go to <greenfoot.org> for more details.

mond@eME732:~$ which java; java -version
/usr/bin/java
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b113)
Java HotSpot(TM) Client VM (build 25.0-b55, mixed mode)
mond@eME732:~$

Revision history for this message
Edmond Condillac (econ22) said :
#8

The required output of the file /usr/bin/greenfoot is as follows:

#!/bin/sh

unset JAVAPATH
unset ARCH

if [ -x /usr/bin/apt-config ]; then
    # Ask apt-config for the architecture
    eval `/usr/bin/apt-config shell ARCH APT::Architecture`
elif [ -x /usr/bin/arch ]; then
    ARCH=`/usr/bin/arch`
fi

for VMNAME in java-7-sun java-7-openjdk java-6-sun java-6-openjdk ; do
    if [ -e /usr/lib/jvm/$VMNAME/lib/tools.jar ]; then
     JAVAPATH="/usr/lib/jvm/$VMNAME"
     break
 elif [ -e "/usr/lib/jvm/$VMNAME-$ARCH/lib/tools.jar" ]; then
     JAVAPATH="/usr/lib/jvm/$VMNAME-$ARCH"
     break
    elif [ -e /usr/lib/jvm/$VMNAME-amd64/lib/tools.jar ]; then
     JAVAPATH="/usr/lib/jvm/$VMNAME-amd64"
     break
    elif [ -e /usr/lib/jvm/$VMNAME-i386/lib/tools.jar ]; then
     JAVAPATH="/usr/lib/jvm/$VMNAME-i386"
     break
    fi
done

if [ x"$JAVAPATH" = x"" ]; then
 echo "A suitable JDK couldn't be located. You may need to edit the"
 echo "/usr/bin/greenfoot launch script."
 exit 1
fi

CP="/usr/share/greenfoot/bluej.jar:$JAVAPATH/lib/tools.jar"
"$JAVAPATH/bin/java" -Dawt.useSystemAAFontSettings=on -cp "$CP" bluej.Boot \
    -greenfoot=true -bluej.compiler.showunchecked=false \
 -greenfoot.scenarios=/usr/share/doc/Greenfoot/scenarios \
 -greenfoot.tutorial=file:///usr/share/doc/Greenfoot/tutorial/tutorial.html \
 -greenfoot.tutorial.scenario=wombats \
 -greenfoot.url.javadoc=/usr/share/doc/Greenfoot/API/index.html \
  "$@"

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#9

No, we are asking for the output of this Terminal command:

file /usr/bin/greenfoot

And what happens if you run this Terminal command in a Terminal ?

/usr/bin/greenfoot

So those are 2 commands above.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

If you copy one of the .desktop files to the desktop from ~/.config/autostart you can modify it as you desire. The Exec= line will be:

Exec=/usr/bin/greenfoot

The rest is as you wish. If you then copy it to /usr/share/applications it will show in Dash.

Revision history for this message
Edmond Condillac (econ22) said :
#11

Sorry Mark, My mistake. The output required is as follows:

mond@eME732:~$ file /usr/bin/greenfoot
/usr/bin/greenfoot: POSIX shell script, ASCII text executable

mond@eME732:~$ /usr/bin/greenfoot
A suitable JDK couldn't be located. You may need to edit the
/usr/bin/greenfoot launch script.

Thank sagain for your help.

Revision history for this message
Edmond Condillac (econ22) said :
#12

The version of Greenfoot being downloaded is version: 2.3.0.

I have also downloaded the required JDK (jdk-7u45-linux-i586.tar.gz) recommended as the compatible JDK for the current version of Greenfoot.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#13

Interesting. It seems you installed Oracle Java 8 using these instructions:

http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

In the end, it was a very good idea of you to send us the contents of the /usr/bin/greenfoot script.

My mistake. :-)

There is a mismatch between your installed Java version (Oracle Java 8) and the list of known Java JDKs in the /usr/bin/greenfoot script.

Please run this command to find out more about your JDK install:

find /usr/lib/jvm -name tools.jar

Using the output of that Terminal command, you can then adapt the contents of the /usr/bin/greenfoot script to also include your Oracle Java 8 install.

Source: https://bbs.archlinux.org/viewtopic.php?id=160792

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#14

However, if the hacking of the /usr/bin/greenfoot script does not work, then you will need to uninstall Oracle Java 8 and install Java 7 JDK instead.

Source: http://www.greenfoot.org/download

I quote from that page:

"Greenfoot requires the Java 6 or Java 7 JDK. Note that you need the version marked JDK; not JRE, Netbeans or Java EE."

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#15

Well. I just tried installing the package http://www.greenfoot.org/download/files/greenfoot-230.deb

via the Terminal in Lubuntu 13.10.

I suspect you did not install the file greenfoot-230.deb correctly.

Because I ran these 2 Terminal commands:

wget http://www.greenfoot.org/download/files/greenfoot-230.deb

sudo dpkg -i greenfoot-230.deb

Then I received the following error message because there were no supported versions of Java installed on my PC (just like in your case):

Selecting previously unselected package greenfoot.
(Reading database ... 318485 files and directories currently installed.)
Unpacking greenfoot (from greenfoot-230.deb) ...
dpkg: dependency problems prevent configuration of greenfoot:
 greenfoot depends on sun-java6-jdk | sun-java7-jdk | openjdk-6-jdk | openjdk-7-jdk; however:
  Package sun-java6-jdk is not installed.
  Package sun-java7-jdk is not installed.
  Package openjdk-6-jdk is not installed.
  Package openjdk-7-jdk is not installed.

dpkg: error processing greenfoot (--install):
 dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils ...
Processing triggers for mime-support ...
Processing triggers for hicolor-icon-theme ...
Errors were encountered while processing:
 greenfoot

So you should NOT download and should NOT install jdk-7u45-linux-i586.tar.gz because that .tar.gz is NOT a standard Ubuntu package.

openjdk-7-jdk is available in the Ubuntu repositories, just like my Terminal output above says.

openjdk-7-jdk is a prerequisite for running greenfoot.

So you only need to uninstall Oracle Java 8 and then run this command in the Terminal to install openjdk-7-jdk:

sudo apt-get install openjdk-7-jdk

Revision history for this message
Edmond Condillac (econ22) said :
#16

I edited the launch script of file /usr/bin/greenfoot with the entry java-7-oracle java-7-oracle.

Revision history for this message
Edmond Condillac (econ22) said :
#17

My thanks for the guidance in helping to bring about the resolution of the problem with launching Greenfoot. Thanks to all.