Java jenkins setup

add `and tomcat is defined` to conditional