Raja Pandian C wrote:Depends what you mean, so the following is one possibility (should be correct but I didn't verify details.)
The input to the executable jar file should be fetched from the arguments given in the batch file which will be taken as the input for the java program.
@echo off REM Run app set ARG1=3 set ARG2=some text set MY_CLASSPATH=... java -cp "%MY_CLASSPATH%" com.company.product.MyApp "%ARG1%" "%ARG2%" echo App is done pause
ya but how to give the input via a batch file.The same way you would give it on the command line.
whats the syntax to execute the program with any input ?Ditto. Provide the filename as an argument as shown in answers above.
what if i want the user to give the input at runtime. what are the changes to be made in the code ?I've already answered that. Use the String args. This is very basic Java that you should already know.
previously_prompted_for_parameter = args;
What is the batch command to replace args ?There is no batch command to replace args. The question doesn't even make sense. All you have to do is supply the command line argument in the batch file, and you've already been shown how to do that.
Can anyone help me out in the batch code.You've been spoonfed the batch code already. In fact you've been spoonfed far too much already. What I am missing here is any attempt on your part to actually understand what you've been told here.