Installing Greenfoot on a Raspberry Pi

In issuing some Computer Science students with a Raspberry Pi I decided I would like them to be able to program in Python on them (job done already as it comes pre-installed) and I would also like them to be able to use Greenfoot.

I came across a great post on the Raspberry Pi website that I have re-written below with shortcuts to everything needed.

Firstly you need to install Java on the Raspberry Pi.

Create a directory to install it to:

          mkdir -p /opt

Download the Linux Java package from here:

Then decompress the Java package:

          sudo tar zxvf (name of package) -C /opt

Make sure it’s installed ok, this should return the version:

          sudo /opt/jdk1.8.0/bin/java -version

Now that Java is installed, you can go ahead and install Greenfoot once you have downloaded the Pure Java Version from here.

Greenfoot can be installed using the following command:

          sudo /opt/jdk.8.0/bin/java -jar /home/pi/GreenfootVersion.jar

A window should pop up with details of where Java is installed and where you want to install Greenfoot, click install then done.

Providing you kept to the defaults you can now run Greenfoot from the greenfoot script in the /home/pi/greenfoot directory or by using the ./greenfoot command from within the Greenfoot directory.

Happy coding!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s