make input code work on ruby 1.9
support OPEN and CLOSE in the Java backend

lang_java is now feature complete