Is there a way to redirect input from file to stdin in Netbeans?

后端 未结 5 1371
忘了有多久
忘了有多久 2020-12-31 09:11

I\'m developing application with Netbeans and Maven. My application should obtain data from stdin. But I could not understand how to test it. Putting < data.txt

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 09:37

    Old school, but it's what I knew. One caveat is that the mvn command does not return to the cli when done, but for some purposes this is acceptable. Note you need to be in the project root directory

    mvn "-Dexec.args=-classpath %classpath com.mycompany.test" -Dexec.executable=/Downloads/jdk1.7/bin/java exec-maven-plugin:1.2.1:exec < /tmp/Input

提交回复
热议问题