Added a bit better java support