tomcat document page: https://tomcat.apache.org/tomcat-8.5-doc/appdev/processes.html
BEFORE TOMCAT STARTED KONSOLE OUTPUT kub18@UB18:~/myapp$ ant install Buildfile: /home/kub18/myapp/build.xml Trying to override old definition of datatype resources prepare: compile: [javac] /home/kub18/myapp/build.xml:293: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds install: BUILD FAILED /home/kub18/myapp/build.xml:369: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) AFTER TOMCAT STARTED kub18@UB18:~/apache-tomcat-9.0.30/bin$ ./startup.sh Using CATALINA_BASE: /home/kub18/apache-tomcat-9.0.30 Using CATALINA_HOME: /home/kub18/apache-tomcat-9.0.30 Using CATALINA_TMPDIR: /home/kub18/apache-tomcat-9.0.30/temp Using JRE_HOME: /usr Using CLASSPATH: /home/kub18/apache-tomcat-9.0.30/bin/bootstrap.jar:/home/kub18/apache-tomcat-9.0.30/bin/tomcat-juli.jar Tomcat started. KONSOLE OUTPUT kub18@UB18:~/myapp$ ant install Buildfile: /home/kub18/myapp/build.xml Trying to override old definition of datatype resources prepare: compile: [javac] /home/kub18/myapp/build.xml:293: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds install: BUILD FAILED /home/kub18/myapp/build.xml:369: java.net.ProtocolException: Server redirected too many times (20) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1908) After inserting <presetdef name="javac"> <javac includeantruntime="false" /> </presetdef> KONSOLE OUTPUT ant install Buildfile: /home/kub18/myapp/build.xml Trying to override old definition of task javac Trying to override old definition of datatype resources prepare: compile: install: BUILD FAILED /home/kub18/myapp/build.xml:372: java.net.ProtocolException: Server redirected too many times (20) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1908)