ClassNotFoundException when calling gpt from the command line


Since I updated snap, when I try to run a graph.xml from the command line, I end up with a ClassNotFoundException for the GPT class!

Is it just a bug that’s going to be fixed with future releases? Or did I make a mess when updating?

hakim@hakim ~/Data $ sudo /home/hakim/snap/bin/gpt /home/hakim/Data/York/preprocessing-pre.xml
Error: java.lang.ClassNotFoundException: org.esa.snap.framework.gpf.main.GPT
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.esa.snap.framework.gpf.main.GPT
at org.esa.snap.runtime.Launcher.lambda$run$12(
at org.esa.snap.runtime.Engine.runClientCode(
at org.esa.snap.runtime.Launcher.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.exe4j.runtime.LauncherEngine.launch(
at com.install4j.runtime.launcher.UnixLauncher.main(
Caused by: java.lang.ClassNotFoundException: org.esa.snap.framework.gpf.main.GPT
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at org.esa.snap.runtime.Launcher.lambda$run$12(
… 9 more


Have you tried with the latest release? You seem to be using an older
version by the looks of org.esa.snap.framework

You’re right, it’s working now that I installed the last version of snap.

As the name suggests classNotFoundException in Java occurs when JVM (Java Virtual Machine) tries to load a particular class and doesn’t found the requested class in the classpath you specified. This means that, your classpath is broken (which is a very common problem in the Java world ). This problem can be particularly confusing for Java beginners. ClassNotFoundException is a checked exception , so it has to be catch or thrown to the caller.