/* jquery */ /* jquery accordion style*/ /* jquery init */

25 October 2013

Raspberry Pi Minecraft with BlueJ

Mojang created a special Raspberry Pi version of Minecraft specifically to encourage game hacking. This free version of the game includes Python and Java API's.

The API and Demo packages contain numerous classes. But what's a good tool for navigating the code?

Well, a visual way to begin Minecraft hacking in Java is with the BlueJ editor.

A recent Michael Kolling's Oracle Java Magazine article demonstrates how to install and run the Pi-friendly BlueJ 3.14 on your Raspberry Pi.

Open the API root source file folder as a Non-BlueJ Project. Now you'll have a class diagram for each package and a syntax-highlighting editor to browse the code. You can do the same for the Demo source code.

The images below give a flavour of how it will look.

The main 'pi' package:

The pi.event package:

The pi.demo package:

Source code for the LowLevelDemo class:

Javadoc for the Log class:

More Raspberry Pi Coding, Tips and Tricks

22 October 2013

Raspberry Pi BlueJ Learning Videos

Are you just starting to code with the Java language and looking for a little help?

As I discussed previously the BlueJ editor is a great tool for beginners.

Recently I noticed object first with java, a comprehensive collection of videos which walk you through the basics of Java development with the BlueJ editor.

At the time of this post there's twelve in the collection.

More Raspberry Pi Coding, Tips and Tricks

17 October 2013

Raspberry Pi Java with BlueJ

So the Raspberry Pi has a new performance-enhanced port of Oracle Java programming language.

But some of the traditional Java IDEs like Eclipse and Netbeans are large, memory-hogging applications. Is there a more Pi-friendly alternative?

The BlueJ Java programming environment aims to teach the fundamentals of object orientation (OO) design. While similar in concept to the closely related Greenfoot project BlueJ is targeted at students or anyone wishing to explore modern programming concepts through experimentation.

A graphical programming interface helps to visualise the high-level OO design, as opposed to just diving into the code. Behind the scenes there a full source code editor with built-in compiler, syntax-highlighting, scope-visualisation and auto-completion, plus an interactive testing mode.

It's an ideal solution when working with an unfamiliar set of Java classes, such as Mojang's Minecraft API for the Pi.

A recent Michael Kolling's Oracle Java Magazine article demonstrates how to install and run the Pi-friendly BlueJ 3.14 on your Raspberry Pi.

Alternatively, if your Pi is running the Raspbian image the BlueJ website has a Debian-specific .deb file download. After downloading move to the download directory, then execute this command in a terminal window:

$ dpkg -i bluej-314.deb

Below is a screenshot of BlueJ in action:

More Raspberry Pi Coding, Tips and Tricks

15 October 2013

Raspberry Pi Java with Greenfoot

So the Raspberry Pi has a new performance-enhanced port of Oracle Java programming language.

But some of the traditional Java IDEs like Eclipse and Netbeans are large, memory-hogging applications. Is there a more Pi-friendly alternative?

The Greenfoot Java programming offers a highly visual way to teach the basics of object oriented (OO) design through simple user interactions. Aimed at coding beginners from around 11 upwards it's suitable for home-based or classroom learning scenarios.

With a graphical interface (see below) centred around user-defined actors that live in class-based worlds, Greenfoot offers an interactive and fun way to build games and simulations.

However, don't be fooled by the playful interface. All Greenfoot programs are built using standard Java. Behind the scenes there a full source code editor with built-in compiler, syntax-highlighting, scope-visualisation and auto-completion.

So the skills you'll acquire will be applicable to general Java development and other similar object oriented languages.

For Pi owners the pure-Java jar file version is the best option. Simply download the file, move to the download directory, then execute this command in a terminal window:

$ java -jar Greenfoot-generic-230.jar

You could create a desktop short cut which executes the above command for a more convenient single-click solution.

The Greenfoot website has plenty of helpful information and resources. Visit the documentation page to view the introductory tutorials, or take a look at the excellent collection of videos at the Joy of Code YouTube channel.

More Raspberry Pi Coding, Tips and Tricks

12 October 2013

Raspberry Pi Java with DrJava

So the Raspberry Pi has a new performance-enhanced port of Oracle Java programming language.

But some of the traditional Java IDEs like Eclipse and Netbeans are large, memory-hogging applications. Is there a more Pi-friendly alternative?

Dr Java is one option. The classic interface has all the features you'd expect, such as syntax highlighting and one-click compilation or execution. There's a useful quickstart guide on the website.

For the Pi the pure-Java jar file version is the best option. Simply download the file, move to the download directory, then execute this command in a terminal window:

$ java -jar drjava-stable-20130901-r5756.jar

You could create a desktop short cut which executes the above command for a more convenient single-click solution (note: it can take a little while for the editor window to appear).

A screenshot of the Dr Java editor with a classic Hello World class appears below.

More Raspberry Pi Coding, Tips and Tricks

10 October 2013

Raspberry Pi Java with Geany

The Geany editor is already a popular editor for Python programming.
But it has a Java side too.

Here's a few of the Java-friendly features:

colourful syntax-highlighted Java source code
visual Java class and function navigation
easy code compilation via the 'Build' menu option or F8
easy class execution via the 'Build' menu option or F5

Below is a screenshot of how the classic 'Hello World' class looks in Geany.

More Raspberry Pi Coding, Tips and Tricks