How to run and debug SNAP from an IDE -IntelliJ IDEA - Error

i used the parameters specified in this link https://senbox.atlassian.net/wiki/spaces/SNAP/pages/24051775/IntelliJ+IDEA

and more specifically the ones
Main class: org.esa.snap.nbexec.Launcher
VM options: -Dsun.java2d.noddraw=true -Dsun.awt.nopixfmt=true -Dsun.java2d.dpiaware=false -Dorg.netbeans.level=INFO -Dsnap.debug=true -Xmx4G
Program arguments: --userdir “/home/ahmad/Documents/Projects/SNAP/snap-desktop/snap-application/target/snap/…/userdir” --patches “/home/ahmad/Documents/Projects/SNAP//snap-engine/$/target/classes:/home/ahmad/Documents/Projects/SNAP/s1tbx/$/target/classes” --clusters “/home/ahmad/Documents/Projects/SNAP/s1tbx/s1tbx-kit/target/netbeans_clusters/s1tbx”

I get the following error:
Exception in thread “main” java.lang.IllegalStateException: Not a valid installation directory: /home/ahmad/Documents/Projects/SNAP
at org.esa.snap.nbexec.Launcher.run(Launcher.java:101)
at org.esa.snap.nbexec.Launcher.main(Launcher.java:86)

Its looking for an directory called etc and another one called platform which are not exist, I tried to create them manually to see what they are and it seems some configurations for clusters which I don’t have its files also
How to solve that?

What have you specified as Working directory?
I guess in your case it should be
/home/ahmad/Documents/Projects/SNAP/snap-desktop/snap-application/target/snap

Also, the path to the userdir looks strange. Change it to.
/home/ahmad/Documents/Projects/SNAP/snap-desktop/snap-application/target/userdir

In the patches directory, I see a duplicated ‘/’. Don’t know if this can cause trouble

Thanks for your help
You was right about working directory.
But I figured out something not in the documentation that you need to build the snap-desktop & snap-engine before do the configuration otherwise IntelliJ IDEA will reject the paths as target not exist
Also the path to the userdir is ok no need to change it.

Thanks :slight_smile:

I’ve updated the guide to mention this. Thanks for pointing this out.

I have found another point in the documentations related to “How to create a new product reader”
manifest.mf need to update.
OpenIDE-Module-Layer: org/esa/snap/dataio/<format-name>/layer.xml
should be
OpenIDE-Module-Layer: e/g/org/esa/snap/dataio/<format-name>/layer.xml

In general in case if I found anything how should I report it?

That’s the right way to report such things.

Actually, the path is correct. In the section where the layer.xml is created the path should only be org.esa.snap.dataio.<format-name>

image
The e.g. before the path is not part of the path. This is not clear, I admit.
So I changed it to this:
image

another point in documentation I think it relate for the same name

Java code
  1. create package e.g. org.esa.snap.dataio.<format-name>

at this page
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/10584125/How+to+create+a+new+product+reader
I think it need to change to the same
org.esa.snap.dataio.<format-name>

Yes, I just replaced e.g. by for example