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? The problem is, that you're importing libraries from the sun.com. package. 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.
We just have to set some jar files and dll files and we are done. Just a minute we are showing it step by step. Here we start, How To Capture Webcam Images In Java Swings With LTI-CIVIL Library 1) Install java and net beans if you haven’t installed them yet. Import com.sun.image.codec.jpeg.JPEGImageEncoder; import java.awt.event.
Also, if what you want is to simply read or write a JPEG file, take a look at the class, there are plenty of useful methods in there.
Yding 2011-12-28 16:40:18 UTC - screen shot - Compiling 451 source files to C: Documents and Settings yding My Documents NetBeansProjects GuessWeb build classes warning: options bootstrap class path not set in conjunction with -source 1.6 C: Documents and Settings yding My Documents NetBeansProjects GuessWeb src com hp hpl guess piccolo GFrame.java:29: error: package com.sun.image.codec.jpeg does not exist import com.sun.image.codec.jpeg.; - problem description - NetBean can not found 'com.sun.image.codec.jpeg' which is in rt.jar. The above is from my 64bit Window XP computer. My other 32bit computer works without problem.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |