I have a few questions because it seems the basis of my problems is I'm not understanding how to properly run my java class files from the command prompt and have them take arguments.
I have my project folder 'ProjectDNA
' and within this directory is my commands.txt
that I would like my class to call as an argument.
ProjectDNA\src\package\dna\sequencer
is the class I am trying to call.
My issue is I am able to compile the sequencer in a command prompt from ProjectDNA\src\package\dna
, but only execute it from
ProjectDNA\src
This only brings in more confusion when the .txt file I need it to process as an arg is in ProjectDNA\commands.txt
After going through some other similar questions here. here, here, and looking at oracles documentation I'm not 100% on how I am supposed to efficiently compile,run, and take the txt file as an argument. Where should I be calling these commands and how should the syntax be in the command prompt? When I run from my src file:
java -cp . package.dna.Sequencer commands.txt
I receive
java.io.FileNotFoundException: commands.txt (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at package.dna.Sequencer.process(Sequencer.java:55)
at package.dna.Sequencer.main(Sequencer.java:113)
Any help would be greatly appreciated.