通过Eclipse插件在工作区中运行一个类?

时间:2021-08-10 21:30:15

I am working on an Eclipse plug-in project and I want to to be able run a specific class via this plug-in.

我正在开发一个Eclipse插件项目,我想通过这个插件运行一个特定的类。

For example I added a button to the eclipse interface and I want this button runs one specific Java class.

例如,我在eclipse界面添加了一个按钮,我希望这个按钮运行一个特定的Java类。

I am looking through the tutorials etc but I couldn't find how to make this.

我正在浏览教程等,但我找不到如何做到这一点。

Is there anyone that can give me some intuition?

有没有人可以给我一些直觉?

Best

1 个解决方案

#1


You could use Runtime.exec(). But for a cleaner approach refer 'Commons Exec' library.

您可以使用Runtime.exec()。但是为了更清洁的方法,请参考'Commons Exec'库。

#1


You could use Runtime.exec(). But for a cleaner approach refer 'Commons Exec' library.

您可以使用Runtime.exec()。但是为了更清洁的方法,请参考'Commons Exec'库。