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.JPE
The problem is, that you're importing libraries from the sun.com.*
package. Oracle actually discourages the use of these packages, since they could be removed in future releases or may not be available in all JVM implementations.
It's possible that your IDE (which one are you using?) is configured for generating errors if you try to import sun.com.*
libraries, in that case a configuration change will allow you to use those libraries, but it wouldn't be a good idea anyway. You should look for other alternatives to the functionality you seek, using libraries with no access restrictions.
Also, if what you want is to simply read or write a JPEG file, take a look at the ImageIO class, there are plenty of useful methods in there.