1

I currently have a package containing a main method that checks and uses the arguments passed through to it. I am wondering how a user would be able to supply these arguments through the command line? Would a JAR file needed to be created, if so how can I go about doing that?

mcgillian
  • 97
  • 7
  • See http://stackoverflow.com/a/42200519/104891. – CrazyCoder Oct 25 '17 at 01:01
  • Possible duplicate of [how to pass command line arguments to main method dynamically](https://stackoverflow.com/questions/8756377/how-to-pass-command-line-arguments-to-main-method-dynamically) – Dmitry Oct 25 '17 at 11:24
  • When you run it, you run it with `java -jar jarfile.jar argument argument2`. To build it use the suggested answer from @CrazyCoder above or use something like maven or gradle or another build tool to build your jar if you need to do it more often than once. – flob Oct 25 '17 at 14:46

0 Answers0