Sunday 27 October 2013

Setting the Raspberry Pi's JAVA_HOME

The new Raspberry Pi build of Raspbian now comes with Java 1.7 pre installed.

If you need to set JAVA_HOME it can be set by carrying out the following to your ~/.bashrc

nano ~/.bashrc

then add the following and save the changes

export JAVA_HOME="/usr/lib/jvm/jdk-7-oracle-armhf"
export PATH=$PATH:$JAVA_HOME/bin

when you next login try typing:

 export

you will see a list of values, one of which should be

declare -x JAVA_HOME="/usr/lib/jvm/jdk-7-oracle-armhf"

A guide for installing and setting up the java 8 preview is available at :
http://www.savagehomeautomation.com/raspi-jdk8

Sunday 6 October 2013

MineCraft: Pi Edition Java Api

I saw a recent post on Raspberry Pi Spy about the Pi edition of MineCraft having a python API and thought it might be fun to play with. After installing, it seems it also has a Java Api which closely follows the Python. The next question was what to write, always a sticking point. I decided upon flipping things on their head a little and have a joystick in MineCraft control my trusty PiBot (I've tried to control it with everything else why not this). Hitting one of the blocks via a right click would launch the Bot into action.




The Bot is controlled by a Web service, so no changes were needed from the code previously written to talk to an android tablet.

The Api includes some examples written by Daniel Frisk along with a Javadoc and Martin O'Hanlon has written some good Python tutorials on his blog http://www.stuffaboutcode.com.


My resulting code can be found at
:https://bitbucket.org/chughes42/minecraft-pi

and the Pibot code is at

https://bitbucket.org/chughes42/remotepibot