I have written one java class and created jar file. I need to pass one parameter to the jar file.
public class parser{
private static final String FILENAME = "C:\\output.txt";
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(new File("C:\\Users\\Desktop\\input.json"));
//some logic here....
}
}
I have written different methods which will write data to output.txt
I can pass parameter for scan object to jar file and access in the main method using args[] however I want to pass value to FILENAME variable from command line while executing jar command
I am not sure how to do that in java