Wednesday, March 26, 2014

How to pass arguments in standalone Java Class without command line

In JDeveloper when you write a java class with a main() method which takes no argument, What you do for running it is, you just right click the java file and select Run to run the program.

 But suppose the main() method takes arguments, how do you pass your arguments to the program?
 This is especially a problem as I use the studio version of JDeveloper.

There are two solutions to it.

  1. Right-click the project > Project Properties... > Run/Debug/Profile > Edit the Run Configurations-> Launch Settings -> Program Arguments (Put your arguments here) as shown in snap below
  2. You can also go to "Tool Setting" and check the box for "Allow the program input" for inputting from keyboard.





No comments:

Post a Comment