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
I am not sure how it is in NetBeans but in eclipse you can write something to console and it is redirected as STDIN to running application. I believe the same should work in NetBeans too. So, just run your application, then copy/paste content of data.txt to console and probably press .
If nothing help use remote debugging, i.e. run your program from command prompt as following:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y MyProgram < data.txt
then connect to this process from NetBeans.