eclipse - Giving input to Java through a batch file -


i developing application in users give input in batch file , batch file input given input eclipse , oy run java program(logic) , give output either through batch file or excel.

in eclipse can set arguments using run > run configurations > arguments

running jar file directly works simple: java -jar somefile.jar port ip whatever else

those arguments passed main() method string[], if want numbers have convert them.

public static void main(string[] args) {          system.out.println(args[0]); // port         system.out.println(args[1]); // ip         system.out.println(args[2]); // whatever         system.out.println(args[3]); // else     } 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -