...
- Java IDE, e.g. IntelliJ IDEA
- Python IDE, e.g. PyCharm
- JDK 811
- Maven 3
Java single module extension
...
- Path to JAR: <
snap-app>/
snap/modules/ext/org.esa.snap.snap-rcp/org-esa-snap/snap-main.jar - VM options:
-Dsun.java2d.noddraw=true
-Dsun.awt.nopixfmt=true
-Dsun.java2d.dpiaware=false
-Dorg.netbeans.level=INFO
-Xmx4G
- Program arguments:
--clusters "<my-module>/target/nbm/netbeans/<clusterName>" --patches "<my-module>/$/target/classes" --userdir "<my-module>/target/userdir"
- Working directory:
<snap-app>
The variable <clusterName>
depends on the configuration of the nbm-maven-plugin in your <my-module>/pom.xml
file. The configuration property cluster defines the name of the cluster. The default value is extra (i.e replace <clusterName> with extra)
. For multi-module projects let --clusters
option point to the aggregation directory:
- Program arguments:
--clusters "<my-module>/target/netbeans_clusters/<clusterName>" --patches "<my-module>/$/target/classes" --userdir "<my-module>/target/userdir"
Debugging and Running with GPT of SNAP Engine
If you want to debug, run and test a processor extension (GPF operator) without the GUI but using the SNAP gpt
command-line tool, create a new configuration of type JAR Application (since version 14) and give it a name, e.g. SNAP GPT
. Again, make sure to set the path of <snap-app>
depending on whether you are using a checked-out version of SNAP from https://github.com/senbox-org/snap-desktop or an installed SNAP:
- Path to JAR: <
snap-app>/snap/modules/ext/org.esa.snap.snap-core/org-esa-snap/snap-runtime.jar
- VM options:
-Dsnap.mainClass=org.esa.snap.core.gpf.main.GPT -Dsnap.extraClusters=<my-module>/target/nbm/netbeans/<clusterName>
-Dsnap.log.level=ALL
-Xmx4GXmx10G
- Program arguments:
<my-operator> ... (any GPT options and operator parameters here)
- Working directory:
<snap-app>
NetBeans IDE
Select File/Open Project and select the directory <my-module>
which contains your project's pom.xml
file. Build the project using Run/Build Project or use the toolbar button. In the Projects tool window, double-click Project Files/settings.xml
(points to ~/.m2/settings.xml
) and make sure it contains a profile defining a property netbeans.installation
whose value points to the value of <
:snap-app>
Code Block | ||||
---|---|---|---|---|
| ||||
<settings> ... <profiles> ... <profile> <id>netbeans-snap</id> <properties> <netbeans.installation>Put the value of ${snap-app} in here</netbeans.installation> </properties> </profile> </profiles> </settings> |
Save the settings.xml
file. A new entry netbeans-snap
will appear in the Run Configuration drop-down list in the NetBeans toolbar and select the Run Project toolbar button next to it.
Eclipse IDE
...