Invoking Java main method with parameters from Eclipse

后端 未结 6 823
终归单人心
终归单人心 2020-11-28 05:59

During development (and for debugging) it is very useful to run a Java class\' public static void main(String[] argv) method directly from inside Eclipse (using th

6条回答
  •  情歌与酒
    2020-11-28 06:39

    AFAIK there isn't a built-in mechanism in Eclipse for this.

    The closest you can get is to create a wrapper that prompts you for these values and invokes the (hardcoded) main. You then get you execution history as long as you don't clear terminated processes. Two variations on this are either to use JUNit, or to use injection or parameter so that your wrapper always connects to the correct class for its main.

提交回复
热议问题