documents:100825imagej_eclipse_debugging
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documents:100825imagej_eclipse_debugging [2011/08/31 11:36] – created kota | documents:100825imagej_eclipse_debugging [2016/05/24 12:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Setting Up Eclipse Debugging Environment for ImageJ Plugin Development ====== | ====== Setting Up Eclipse Debugging Environment for ImageJ Plugin Development ====== | ||
- | Eclipse IDE is an extremely useful IDE but very complicated on first look (and on second, third... for me). Setting environment is important for efficient development but this preparation actually is not so straight forward. Some step-by-step instructions are available [[http:// | + | Eclipse IDE is an extremely useful IDE but very complicated on first look (and on second, third... for me). Setting environment is important for efficient development but this preparation actually is not so straight forward. Some step-by-step instructions are available [[http:// |
Following these instructions does enable you to develop nicely. With these instructions, | Following these instructions does enable you to develop nicely. With these instructions, | ||
- | For myself, | + | For myself, the most difficult configuration |
- | I expose one of my debug/run setting of ImageJ plugin development in Eclipse. Note that this is not the only way, and the most important setting is " | + | I expose one of my debug/run setting of ImageJ plugin development in Eclipse. Note that this is not the only way, and also keep in mind that the most important setting is " |
- | **Main tab** | + | Configuration below assumes that the compiled plugin (e.g. jar file) is already copied to the plugin folder of ImageJ or Fiji plugin folder. Automatic copying of compiled jar file to the plugin folder is normally done with Ant, the build.xml file. I do not explain about this here, so please refer to the fore mentioned tutorial links. |
+ | |||
+ | Panels shown below are from Eclipse " | ||
+ | |||
+ | ===== Main tab ===== | ||
Run/Debug configuration is done via [Run -> Run Configurations...] from the menu. You will see a panel, with left column listing your Run setups and in the right several tabbed panels for setting parameters. Here is the " | Run/Debug configuration is done via [Run -> Run Configurations...] from the menu. You will see a panel, with left column listing your Run setups and in the right several tabbed panels for setting parameters. Here is the " | ||
+ | |||
[{{ : | [{{ : | ||
- | {{ : | + | In Project field, select the ImageJ plugin project that you want to debug or run. In Main class field, set ij.ImageJ as the main class. This causes Run to start up ImageJ. If you type fiji.Main, then Fiji will start up. For these classes to be recognizable by Eclipse, you could set your working directory to ImageJ folder (see the next tab " |
- | {{ : | + | |
- | {{ : | + | There are three check boxes below these fields. I have never checked on up until now. If you have problem in grabbing Fiji main class, checking both " |
- | {{ : | + | |
+ | ===== Arguments tab ===== | ||
+ | |||
+ | Arguments tab sets options to be sent to Java virtual machine (VM arguments field) and optional arguments passed to ImageJ or Fiji (Program arguments field). Working directory sets the base directory where the Run/Debug will consider as root. | ||
+ | |||
+ | [{{ : | ||
+ | |||
+ | **VM Arguments** | ||
+ | |||
+ | In the above example, I set " | ||
+ | < | ||
+ | java -Xms256m -Xmx1000m | ||
+ | </ | ||
+ | ...which sets the memory minimum (256M bytes) and the maximum (1Gbytes). There are may options available with java. Any of them could go into the VM arguments fields. You could check all these options by typing "java -help" in your terminal. There is also description available in the following Oracle page. | ||
+ | |||
+ | * [[http:// | ||
+ | |||
+ | Some options you could try out when you do not see any plugins listed in the [Plugins >] (though you have them in the plugins folder) is -D.plugins.dir option. VM field could be something like | ||
+ | < | ||
+ | -Xms256m -Xmx1000m -Dplugins.dir=C: | ||
+ | </ | ||
+ | |||
+ | ** Program Arguments ** | ||
+ | |||
+ | Options added to this field will be passed to ImageJ or Fiji. | ||
+ | < | ||
+ | -macro C: | ||
+ | </ | ||
+ | In the above case, -macro option with file path passed to ImageJ will run the script automatically. By adding this option, I automatized the processing after launching ImageJ, to open an image stack, import data into results table and run plugin (the plugin I am debugging or test running). This is same as executing the following in command line | ||
+ | < | ||
+ | java -jar ij.jar -macro C: | ||
+ | </ | ||
+ | |||
+ | Just as an example, below is the script. | ||
+ | <sxh javascript> | ||
+ | //dotlinker Debugger | ||
+ | // to be called from Eclipse | ||
+ | // 20110831 | ||
+ | IJ.open(" | ||
+ | imp = IJ.openImage(" | ||
+ | imp.show(); | ||
+ | IJ.run(imp, " | ||
+ | </ | ||
+ | |||
+ | Options that could be passed to ImageJ are listed in the following page: | ||
+ | |||
+ | * [[http:// | ||
+ | |||
+ | **Working Directory** | ||
+ | |||
+ | Normally, this could be set to the default location, the directory where the project files are. This directory is set by using variable **workspace_loc**, | ||
+ | |||
+ | I set this folder to **${workspace_loc: | ||
+ | |||
+ | ===== JRE tab ===== | ||
+ | |||
+ | You could choose JRE with different versions in this tab. I normally do not touch this, but if there is any indication that JRE version is causing error, you could test them around by selecting " | ||
+ | |||
+ | [{{ : | ||
+ | |||
+ | ===== Classpath tab ===== | ||
+ | |||
+ | This sets the java -classpath (or -cp) options. External libraries you set in the project properties "Java Build Path - libraries" | ||
+ | |||
+ | [{{ : | ||
+ | |||
+ | ===== Source tab ===== | ||
+ | |||
+ | [{{ : | ||
+ | |||
+ | ===== Other tabs ===== | ||
+ | |||
+ | There are two more tabs, " | ||
documents/100825imagej_eclipse_debugging.1314790603.txt.gz · Last modified: 2016/05/24 12:46 (external edit)