Saturday 21 November 2015

Building a retro joystick

I've been thinking about building a reto arcade machine for a while now but I keep getting stuck on the costs. Even doing it on the cheap will end up costing about 500 pounds which is a lot for a novelty. Last week I decided the best way to eat this elephant is one bite at a time and so bought a joystick, some buttons, a usb joystick interface and a cheap wooden box. Pair that with an excited 5 year old and you have the 2 hour project shown below.


Martin has been excidedly decorating the box with markers and stickers for the past few days
We use a 28mm hole drill to drill holes for the buttons and joystick. Obviously I did this although Martin did pretty much the rest of the project.
Wiring up the joystick and switches are simple as it's just a case of pushing on the spade connectors.
Now to test it out with a bit of R-Type

Here's a video of the button being assembled: assembly video

Here's a quick play-test video:


The joystick kit came from Arcade World UK, and cost 28 pounds.
The box cost about 4 pounds from Amazon.



Friday 8 May 2015

Installing oracle jdk 8 on Centos 7.1

I want to install the java 8 jdk and to use that with groovy. That should be simple enough - but downloading the rpm and updating /etc/alternatives does not work. The problem is that the rpm installs java to a non-standard location and so groovy gives this error:

$ groovy -v
/bin/build-classpath: Could not find ../../jvm/java/lib Java extension for this JVM
/bin/build-classpath: error: Some specified jars were not found
Groovy Version: 1.8.9 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Linux

The solution is to install the tar.gz file version. First download it from Oracle.
Then, untar it and move the resulting directory to /usr/lib/jvm
tar xzf jdk-8u45-linux-x64.tar.gz
sudo mv jdk1.8.0_45 /usr/lib/jvm

Next, we set up the alternatives:

sudo alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_45/jre/bin/java 20000
sudo alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8.0_45/bin/jar 20000
sudo alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_45/bin/javac 20000
sudo alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0_45/jre/bin/javaws 20000

Now, we can set the java version we want using update-alternatives:

sudo update-alternatives --config java
sudo update-alternatives --config jar
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Now groovy also expects to find the active java installation at /usr/jvm/java, so we need to link that to our active java. I don't really like this option as it breaks the alternatives structure we set-up earlier, but at the moment I don't have a better solution.

sudo mkdir /usr/jvm
sudo ln -s /usr/lib/jvm/jdk1.8.0_45 /usr/jvm/java

And now everything is groovy:

groovy -v Groovy Version: 1.8.9 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Linux