I'm creating an image watermarking program in java and I imported the followings:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
but I get an error that says:
Access restriction: The type
JPEGCodec
is not accesible due to restriction on required libraryC:\Program Files\Java\jre6\lib\rt.jar
Does someone know a way to solve this, or what library should I add in order to access that and where I find that library?
These are in rt.jar, the jar file used as run-time facilities by the JVM, and I would strongly recommend you against adding it as a dependency to your project.
See why here.
The correct way to do what you want to do is described here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With