Add java pattern, main method for java option