Convert main application class  from Groovy to Java