Nari
Nari

Reputation: 53

How to give input as a file to jar application via cmd?

I have a jar file which provides a GUI in windows and it uses text as input, manually in its text box. and perform some calculations on text data. I want to repeat the process for 500 times which is cumbersome manually. Is there any way to do it automatically. Via command prompt? (I am using Win7)

Upvotes: 0

Views: 664

Answers (1)

Nikolay Kuznetsov
Nikolay Kuznetsov

Reputation: 9579

1) If jar is your own app or you have source then you would need to modify the code to store arguments coming from

public static void main (String[] args)

and then setting it to text box like JTextField.setText(args[0]);

2) If it is not your app and you have only jar then check documentation first whether that possibility is provisioned or not. If not but jar itself is simple then you can decompile it using Java Decompiler and then rebuild again with own modifications.

Upvotes: 3

Related Questions