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

后端 未结 5 1370
忘了有多久
忘了有多久 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-31 09:37

    This can be done by adding your own run target to your project's build.xml file. For example:

    
      
        
        
      
    
    

    Note that commands such as Run, Debug, and Test only use your custom build.xml if the Compile on Save feature is turned off for the project. So you will need to ensure that Compile on Save is turned off in your project's properties.

提交回复
热议问题