在Eclipse中运行java代码时如何添加命令行参数?

在Eclipse中运行java代码时如何添加命令行参数?

问题描述:

如何在Eclipse中向JVM添加命令行参数?例如,假设我想在运行JVM时显式添加-cp参数,是可能吗? (我给它举个例子,我意识到我可以添加一个外部Jar到项目设置以获得一个额外的类路径。)

How can I add command line parameters to the JVM in Eclipse? For example, let's say I want to explicitly add -cp argument when running the JVM, is it possible? (I am giving it as an example, I realize I can add an external Jar to the project settings to get an additional classpath.)

我想添加的参数是

The argument I want to add is -agentlib:Shark (on Mac OSx for running a profiler).