I am running OSX 10.11 with IntelliJ 14.1.15.
I have a program that takes a txt file as an argument. I can run it from the terminal via java SearchCmd test.txt , and then it allows me to enter a search query and search for this list.
How to do this from IntelliJ so that I can press the start button and it reads the file and I can enter a search query in the IntelliJ console.
The main class "SearchCmd" contains the main method, as such:
public class SearchCmd {
public static void main (String[] args) throws IOException {
String name;
if (args.length != 1) {
System.out.println ("Usage: java SearchCmd <datafile>");
System.exit (1);
}
HTMLlist l = Searcher.readHtmlList (args[0]);
}
However, when I try to run this, it says: "Usage: java SearchCmd".
To transfer the test.txt file to IntelliJ, I entered the file path in "Run / Debug Configurations". Sorry, I can’t attach the photo.: - (
IntelliJ .
user3735005