I am trying to pass parameter to a java class main method I want to pass parameter using eclipse so I went to
run -> run configuration -> program arguments
and I wrote my arguments
exp grammar
But whenever I run it gives me this error,
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at LL.main(LL.java:146)
Which means it does not see the second argument "grammar"
, anyone know why and how to solve this ?
edit , here is my main method
public static void main(String[] args) throws IOException {
String exp = args[0] + '$';
LL input = new LL(exp, Grammar.fromFile(args[1]));
try {
input.lLParse();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
}
}