简体   繁体   English

如何在从Eclipse启动的Java程序中添加命令行参数?

[英]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. 为了解决http://kingsfleet.blogspot.com.br/2014/11/but-thats-impossible-or-finding-out.html中记录的JIT问题而日食,但我不确定如何添加。

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. 这是Oracle的javac特有的参数。 Eclipse's Java Builder uses Eclipse's compiler. Eclipse的Java Builder使用Eclipse的编译器。 If you use ant or any other external tool, to run Oracle's javac then you can add arguments for it. 如果使用ant或任何其他外部工具来运行Oracle的javac,则可以为其添加参数。

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. 如果这是运行时选项(因为提到了JIT),则可以在“ 运行配置”对话框中为JRE添加任何参数。


I just skimmed the article you referenced. 我只是浏览了您引用的文章。 It is an argument to 'java', not 'javac' and has nothing to do with building. 它是“ java”而不是“ javac”的参数,与构建无关。 Enter it in the Arguments tab of the Run Configuration dialog. 在“ 运行配置”对话框的 参数”选项卡中输入它。

It seems like you need "boot time parameters" for your Eclipse, well before the projects are loaded. 似乎在项目加载之前就需要Eclipse的“启动时间参数”。 If I have understood the question correctly, have you tried using eclipse.ini? 如果我正确理解了这个问题,您是否尝试过使用eclipse.ini? Here are a few lines from my ini file where I change some parameters. 这是我的ini文件中的几行,我在其中更改了一些参数。

--launcher.appendVmargs$
-vmargs$
-Dosgi.requiredJavaVersion=1.6$
-XX:MaxPermSize=256m$
-Xms40m$
-Xmx1524m$
-Dgrails.console.enable.interactive=false$
-Dgrails.console.enable.terminal=false$
-Djline.terminal=jline.UnsupportedTerminal$
-Dgrails.console.class=grails.build.logging.GrailsEclipseConsole$

If I havent' understood your question, please clarify, if not, hope this helps. 如果我不了解您的问题,请澄清,否则,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何运行从Java程序中获取命令行参数的Python程序 - How to Run a Python Program that Takes Command-Line arguments from within a Java Program 从命令行运行Java程序 - Running Java Program from Command-line 如果子进程是Java程序(带有命令行参数),如何从subprocess.check_output获取输出? - How can I get output from subprocess.check_output if the subprocess is a java program(with Command-line arguments)? 如何在使用 Makefile 运行程序时添加命令行参数? - How to add command-line arguments while running a program using Makefile? 如何使用命令行参数运行Eclipse Maven构建 - How to run Eclipse Maven builds with command-line arguments 如何在Eclipse中设置命令行参数? - How do you set the command-line arguments in Eclipse? 如何让java getRuntime()。exec()运行带参数的命令行程序? - How to get java getRuntime().exec() to run a command-line program with arguments? NetBeans 8.1 Java-当您要运行Java文件时如何添加命令行参数 - NetBeans 8.1 Java - how to add Command-line arguments when you want to run java file 如何在Eclipse调试中添加JAVA命令行参数 - How to add JAVA command line arguments in Eclipse Debug 如何在IntelliJ中使用命令行参数构建java项目 - How to build java project with command-line arguments in IntelliJ
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM