java - how to pass argument to main method in eclipse? -


i trying pass parameter java class main method want pass parameter using eclipse went

run -> run configuration -> program arguments 

and wrote arguments

exp grammar 

but whenever run gives me error,

exception in thread "main" java.lang.arrayindexoutofboundsexception: 1     @ ll.main(ll.java:146) 

which means not see second argument "grammar", know why , how solve ?


edit , here 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);     } } 

in run -> run configuration -> java application -> arguments enter inputs separating space


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -