Jump to content

command line arguments...


chanveil

Recommended Posts

Hi,I am having trouble in passing < symbol as a command line argument. I have to pass file name after that < symbol from which my program will take the input.but when i pass this and print all the command line paramters in the main function it does not print < than sign and any argument that is written after that.....But when i pass the arguments using netbeans IDE by setting the project properties it works perfectly.here is the command i am using to run the program....java EightPuzzle -s BreadthFirst < file_that_takes_14_moves_to_solvethe file name "file_that_takes_14_moves_to_solve" and < than symbol is not printed when i pass it through command line.... but it does when i pass it through netbeans by setting the project properties......any help will be highly appreciated.Regards

Link to comment
Share on other sites

Try putting the arguments in double quotes, i.e.

java EightPuzzle -s BreadthFirst "< file_that_takes_14_moves_to_solve"

Otherwise, the < sign is interpreted by the shell to mean "take the contents of file_that_takes_14_moves_to_solve and send it to the program's standard input"

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...