Robert, author of jamvm has been helping me to resolve some of the issues I've been experiencing. I have tested the same project on a Beaglebone Black running openJDK and it works fine. Unfortunately it won't run on jamvm on the Yun. Robert was saying that the Virtual Machine used by jamvm on the Yun is GNU and no longer supported. However openJDK uses IcedTea.
At the moment I'm a bit screwed as I need a java virtual machine capable of running my project.