Search code examples
javaeclipsejit

How to add command-line arguments to a Java program launched from Eclipse?


I am trying to figure out how to add the command line arguments

 -XX:CompileCommand=print,javax/swing/text/GlyphView,getBreakSpot

to eclipse in order to fix a JIT problem documented in http://kingsfleet.blogspot.com.br/2014/11/but-thats-impossible-or-finding-out.html but i am unsure how to add this.


Solution

  • If this is part of building as indicated in your question's title then: You can't. That is an argument specific to Oracle's javac. Eclipse's Java Builder uses Eclipse's compiler. If you use ant or any other external tool, to run Oracle's javac then you can add arguments for it.

    If this is a runtime option (since you mention the JIT), then you can add any arguments for the JRE in the Run Configuration dialog.


    I just skimmed the article you referenced. It is an argument to 'java', not 'javac' and has nothing to do with building. Enter it in the Arguments tab of the Run Configuration dialog.