Answer the question
In order to leave comments, you need to log in
When compiling and running via Ant, how can I make two classes run sequentially?
There is a client-server application on sockets. How to make it so that when building and running through ant, the server is called first, and after it the client?
Answer the question
In order to leave comments, you need to log in
<target name="run" description="Run jars">
<java jar="path/to/server.jar" fork="true"/>
<waitfor maxwait="5" maxwaitunit="seconds" timeoutproperty="failtimeout">
<socket server="localhost" port="9999"/>
</waitfor>
<if>
<not>
<equals arg1="${failtimeout}" arg2="true"/>
</not>
<then>
<java jar="path/to/client.jar" fork="true"/>
</then>
</if>
</target>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question