Java read String on batch

277 Views Asked by At

I have a batch as follows:

@echo off
java Main 127.0.0.1
pause

Now I want the number after 'Main' in the code above to be a String, so that you can change the String by editing the batch file.

1

There are 1 best solutions below

0
On
public static void main (String args[]) {
....
String IP_STRING=args[0];
....
}

Does this work?