Java getopt implementation