Added a java version

In case someone wanted to try to do the java way