Issue using SNAP GPT : principale com.install4j.runtime.launcher.UnixLauncher

Hello,

I am using SNAP GPT in order to create coregistered stack of multiple Sentinel-1 SLC data. I am using two graphs to do this, one to process the .zip data and one to coregister. I am using these two graphs with GPT on the virtual machine (Linux) that the ESA gave me and it works perfectly. I tried to use it on my personal computer (Linux) and I am having an issue I can’t fix. When I run my bash file, the error is that it can’t find the class “principale com.install4j.runtime.launcher.UnixLauncher”. I think the problem is with GPT and not my files, as I have the same error when I type gpt -h.

Does someone else has already had this problem and could help me ?

Here are the operator terminal output, and the bash and xml file I use.

Thank you,

The operator terminal output :

The .sh file :

The .xlm file :


Can you show us the output from ls -l ./snap/.install4j/i4jruntime.jar? There is no need to post screenshots of terminal output – just copy and past the text into a message.

Thank you for your help. The result is the following :

npaillou@pc-vgacoin:/opt/snap$ ls -l .install4j/i4jruntime.jar
-rw-r–r-- 1 root root 1936048 juil. 17 11:40 .install4j/i4jruntime.jar

It looks like you have installed snap as “root”, maybe by running the installer with “sudo”.
A normal SNAP install is for a single user and will create $HOME/.snap. Are you hoping to share SNAP across more than one user?

The simple fix is to do a normal install for a each user. Given that the data used with SNAP is usually much larger than the space needed for the software, there is usually not much to gain from a shared install. I know some sites discourage users from installing software for each user. If that is your situation, there may be other forum users who have found ways to share at least the SNAP directory, but you will need user <user_home>.snap directories.

Thank you for this explanation. I reinstalled snap and installed it for my single use. Here is the result after that :

npaillou@pc-vgacoin:~$ ls -l ./snap/.install4j/i4jruntime.jar
-rwxrwxrwx 1 npaillou npaillou 1936048 juil. 21 14:50 ./snap/.install4j/i4jruntime.jar

Is snap working now? The -rwxrwxrwx permissions are not normal – they allow anyone to write to the i4jruntime.jar file and also make the file “executable”, which is not necessary. Mine has -rw-r--r--. permissions. This would be a concern in a multi-user system but may not affect your ability to run SNAP.

I changed the permission because SNAP informed me that there was a permission problem to acces the system folder, so I gave permissions to all the folders and files inside /snap, it is not a problem as it is not a multi-user system. I tried to run my graph directly from SNAP and it worked perfectly, but I still have the same issue when i try to run it using gpt with a bash file, the error is still :

Erreur : impossible de trouver ou charger la classe principale com.install4j.runtime.launcher.UnixLauncher

A normal install should not have permission problems, and changing to allow read, write, and execute for all users may run afoul of checks intended to protext users from files with “unsafe” permissions. If you are able to create a fresh user account, e.g., snap_test, you could try running the installer using the new login.

I reinstalled SNAP again on the same account and I did not have any permission problems this time, and I had -rw-r–r-- for i4jruntime.jar permissions, but the error was still there. I managed to solved it by precising the path of the gpt in my .sh file, it must have been that the gpt folder was not in my bash PATH.

Thank you for your help

Glad to see it is working now.

You might have an old gpt script in a directory listed in your PATH. You can check this by running which gpt in a terminal.

To avoid having to specify the ~/snap/bin/gpt you can add ~/snap/bin to your PATH or create symbolic links in a directory that is already in your PATH. The installer gives you the option to create symbolic links in a directory you choose, but it is easy to do this after the installation is complete. Many linux distros check for $HOME/bin and add that to the PATH, so I usually put the symbolic links in $HOME/bin. If you aren’t familiar with creating symbolic links or adding directories to the PATH environment variable, you should have a look at a command-line tutorial such as the one at Linux Command.

2 Likes

You are right, I had indeed an old gpt from a previous installation so I erased it and now it works perfectly.

Thank you for these extra explanations about how to clarify my code and the PATH.

1 Like