This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 206774

Summary: [JDK 7] package com.sun.image.codec.jpeg does not exist
Product: java Reporter: yding
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED INVALID    
Severity: normal CC: jglick
Priority: P3    
Version: 7.0.1   
Hardware: PC   
OS: Windows XP x64   
URL: http://stackoverflow.com/questions/1906673/import-com-sun-image-codec-jpeg
Issue Type: DEFECT Exception Reporter:

Description 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.
Comment 1 Jesse Glick 2011-12-28 17:52:14 UTC
Reproducible in a plain Java SE project by adding e.g.

import com.sun.image.codec.jpeg.JPEGCodec;

to any source, but only when building on JDK 7. .../jdk7/bin/javap com.sun.image.codec.jpeg.JPEGCodec succeeds. Seems that JDK 7 javac just blocks access to this package - not an IDE issue.
Comment 2 yding 2011-12-28 19:33:10 UTC
Thanks for the reply. It is jdk 1.7 problem. 
Change netBean to use 1.6 platform solved the problem.
Comment 3 m_jaggard 2012-11-21 13:49:07 UTC
For those who find this using Google. You can overcome this problem by specifying an additional compiler option (under Project properties -> Build -> Compiling)

-XDignore.symbol.file

http://stackoverflow.com/questions/1906673/import-com-sun-image-codec-jpeg
Comment 4 zzzywcwy 2014-03-05 04:39:31 UTC
I found a very useful JPEGCodec image library (totally free with trial). It may also counts. 

Check this out: 
http://www.rasteredge.com/how-to/winforms-net-imaging/jpeg2000-codec/