Java version scanner code