Question

I'm trying to get command line input into a running java program that I started with ant. However, nothing of what I type in the terminal is redirected to System.in of the java process. Is this normal? I'm using Windows 7 and Ant 1.8.2.

The part of the ant script in question goes like this:

<target name="run-client" depends="compile" description="Run client.">
    <java classname="client.Client" fork="true" classpathref="project.classpath">
        <arg value="localhost"/>
        ... other args
    </java>
</target>
Was it helpful?

Solution

Did you try simply using the input or inputstring from the java task?

http://ant.apache.org/manual/Tasks/java.html

Since it's only the command line you are interested in.

In other case I don't think one is able to interact with a running application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top