How to resolve package com.sun.image.codec.jpeg does not exist?

Sometimes the java project (usually a lower version of Java (1.6 or lower)) results in the following compilation error:- INFO] Compiling 106 source files to /Users/JavaProject/src/java/web/target/classes [INFO] ————————————————————- [ERROR] COMPILATION ERROR : [INFO] ————————————————————- [ERROR] /Users/JavaProject//src/java/web/main/java/net/esi/ppc/presentation/service/CaptchaImageGenerator.java:[24,31] error: package com.sun.image.codec.jpeg does not exist [ERROR] /Users/JavaProject//src/java/web/main/java/net/esi/ppc/presentation/service/CaptchaImageGenerator.java:[25,31] error: package com.sun.image.codec.jpeg does not exist To resolve this issue you […]