Replce tomcat scripts with java interface