Java input parameter from text file
<p>I want to know how I can get data from a text file to a java program from the command line. I am using windows.</p>

<p>I used </p>

<pre><code>Java myprogram &lt; c:\inputfile.txt
</code></pre>

<p>it doesn't work, but when I used </p>

<pre><code>Java myprogram good
</code></pre>

<p>it works. 'good' is the word that i used it as input</p>

<p>FYI: when I used  </p>

<pre><code>Java myprogram good &gt; c:\outfile.txt
</code></pre>

<p>this is for writing output to a text file ..</p>

<p>I need to read from the text file "inputfile.txt" and write to "outputfile.txt"</p>

<p>i used this </p>

<pre><code>Java myprogram "c:\\inputfile.txt" &gt; "c:\\outputfile.txt"
</code></pre>

<p>but not working</p>

<p>This code that i used it </p>

<pre><code>import edu.smu.tspell.wordnet.*;

public class myprogram{
public static void main (String [] args) {

System.setProperty("wordnet.database.dir", "C:\\Program Files (x86)\\WordNet\\2.1\\dict\\");
WordNetDatabase database = WordNetDatabase.getFileInstance();
      String result = "";
        NounSynset nounSynset;
        NounSynset[] hyponyms;
        Synset[] synsets = database.getSynsets(args[0]);

        for (int i = 0; i &lt; synsets.length; i++) { //iteratre over all senses
            String[] wordForms = synsets[i].getWordForms();
            for (int j = 0; j &lt; wordForms.length; j++) {
                System.out.println(wordForms[j]);
            }

} 

}
}
</code></pre>
