问题 I was wanting to use some codes that using sun.awt.image.PNGImageDecoder in my project. The problem is source code is based on Java 8 and my project using JDK 9+ (11). So I got this error: Package ' sun.awt.image ' is declared in module ' java.desktop ', which does not export it to the unnamed module . for import sun.awt.image.* , and: Symbol is declared in module ' java.desktop ' which does not export package ' sun.awt.image ' for using PNGImageDecoder or ImageDecoder etc. After some efforts