简体   繁体   English

如何在Eclipse调试中添加JAVA命令行参数

[英]How to add JAVA command line arguments in Eclipse Debug

I am running the main function of class by running from command line the following: 我通过从命令行运行以下命令来运行类的主要功能:

java -classpath '/Library/apache-tomcat-7.0.62/lib/*:project/webapp/b2c/ROOT/WEB-INF/lib/*' -Xmx3072m  -Xdebug com.myClass

I want to debug this class myClass. 我想调试此类myClass。

But I cannnot do this while running from command line. 但是我无法从命令行运行时执行此操作。

How can I debug myClass from eclipse using the same java -classpath variable 如何使用相同的java -classpath变量从Eclipse调试myClass

Right Click the class file -> Select "Debug As" -> Select "Arguments" Tab (provide the arguments)->Select "Apply" ->Select "Debug". 右键单击类文件->选择“调试为”->选择“参数”选项卡(提供参数)->选择“应用”->选择“调试”。

Right Click the class file -> Select "Debug As" -> Select "Classpath" Tab "Select BootStrap Entries"-> Add JARs "Provide jar file location"-> "Apply" ->Select "Debug". 右键单击类文件->选择“调试为”->选择“类路径”选项卡“选择BootStrap条目”->添加JAR“提供jar文件位置”->“应用”->选择“调试”。

Hope it helps. 希望能帮助到你。

当您尝试运行您的类时,可以编辑“运行配置...”和/或“调试配置...”,并且将有一个参数标签,您可以在其中设置类路径

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM