I have been trying to install the SNAP Python API on my Macbook. Everything (snappy, jpy, SNAP 6 itself) has installed correctly (I think) and I can import snappy without a problem. When I wanted to try the first example proposed at Atlassian, I got the following error:
RuntimeError: java.lang.IllegalArgumentException: org.geotools.styling.StyleFactory is not an ImageIO SPI class
This is caused by the function ProductIO():
p = ProductIO.readProduct()
I was first using Java 10, but after I did some research on this error, it said that Geotools only works with Java up to version 8. After reverting to Java 8, I still got the same error message.
I tried some other example from the snappy example folder, such as snappy_reader_writer_formats.py, and they work without a problem.
Does anyone have a solution to this problem?
Hi Thibauld! I had the same yesterday in OSX 10.14, conda/Python 3.6, Java 10. I tried different jpy builds and OLCI data, but in the end it was the downgrading to Java 8 (and re-building jpy) that helped. Did you make sure that the snappy process uses your Java 8 installation?
Have you tried what @odermatt suggested?
Or what is said here:
It seems to be a problem which is only occuring under rare conditions. There haven’t been many reports in this forum.
What’s your environment you are seeing this error? Good to know would be your Operating system, the Python version, the SNAP version, and the Java version if different from SNAP default Java. Also have you build your own jpy?
I am using it in windows 10
JAVA version 8 update 231
I used maven and VS to build jpy.
files in my python directory: