在Emacs中使用JDE,我想要像Eclipse的运行配置

时间:2023-01-20 18:55:55

I'm using JDE for writing a larger project. Coming from Eclipse, i miss the run configurations. Basically, there are several different classes in the project that i would like to launch. Some of them are applets, some of the are regular classes with a main method. I would also like to be able to specify different run time arguments to them.

我正在使用JDE编写更大的项目。来自Eclipse,我想念运行配置。基本上,我想在项目中推出几个不同的类。其中一些是applet,一些是带有main方法的常规类。我还希望能够为它们指定不同的运行时参数。

Basically, something like this:

基本上,这样的事情:


run_config_1
  applet: false
  main class: package1.subpackage1.ClassX
  arguments: arg1 arg2

run_config_2
  applet: true
  main class: package1.subpackage1.AppletClassX
  arguments:

etc ...

Then I could switch configuration on the fly, testing different parts of the project. So is there something like this for JDE? Or do I have to write it myself? If that is the case, I would like some pointers on the general direction I should take.

然后我可以动态切换配置,测试项目的不同部分。那么JDE有这样的东西吗?或者我必须自己写吗?如果是这种情况,我想就我应该采取的总体方向提出一些指示。

2 个解决方案

#1


Have you looked at what is already available in JDE? E.g. "Running Java Applications" at http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html ?

您是否看过JDE中已有的内容?例如。在http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html上运行“Java应用程序”?

#2


you can switch configrations indeed: use the "project files" for this. in a project file your current JDE settings can be recorded. you can set the arguments for java compile and run to your liking. start with jde-create-new-project. you need to set up new directories for each configuration (=project file).

您确实可以切换配置:使用“项目文件”。在项目文件中,您可以记录当前的JDE设置。你可以设置java编译的参数,并根据自己的喜好运行。从jde-create-new-project开始。您需要为每个配置(=项目文件)设置新目录。

here a generated sample project file

这里是生成的示例项目文件

(jde-project-file-version "1.0")
(jde-set-variables
 '(jde-project-name "mysample")
 '(jde-run-option-application-args (quote ("-v" "mydir")))
 '(jde-run-read-app-args t))

#1


Have you looked at what is already available in JDE? E.g. "Running Java Applications" at http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html ?

您是否看过JDE中已有的内容?例如。在http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug.html上运行“Java应用程序”?

#2


you can switch configrations indeed: use the "project files" for this. in a project file your current JDE settings can be recorded. you can set the arguments for java compile and run to your liking. start with jde-create-new-project. you need to set up new directories for each configuration (=project file).

您确实可以切换配置:使用“项目文件”。在项目文件中,您可以记录当前的JDE设置。你可以设置java编译的参数,并根据自己的喜好运行。从jde-create-new-project开始。您需要为每个配置(=项目文件)设置新目录。

here a generated sample project file

这里是生成的示例项目文件

(jde-project-file-version "1.0")
(jde-set-variables
 '(jde-project-name "mysample")
 '(jde-run-option-application-args (quote ("-v" "mydir")))
 '(jde-run-read-app-args t))