Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what library I need so I can access this com.sun.image.codec.jpeg in Java?

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 library C:\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?

like image 847
adrian Avatar asked Jan 15 '12 13:01

adrian


1 Answers

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.

like image 165
Milad Naseri Avatar answered Sep 28 '22 05:09

Milad Naseri