May 19, 2018 Download sun-jaicodec.jar: sun « s. Codecimpl.ImagingListenerProxy.class com.sun.media.jai.codecimpl.JPEGCodec.class com.sun.media.jai.codecimpl. Recieve error: package com.sun.image.codec.jpeg does not exist import com.sun.image.codec.jpeg.JPEGCodec; Even though the the Libraries folder for the project contains JDK 1.7(Default)which contains rt.jar. Ctrl left click on import com.sun.image.codec.jpeg.JPEGCodec; opens the correct lass from rt.jar.
Original author: [email protected] (December 01, 2012 14:12:07)
In my recent experience processing-2.0 was compiling and running hunky-dory with openjdk-1.7.0_09. I thought it might be an open source issue, because when I compiled with sun/oracle jdk-1.6.0_33), I got the following warnings.
compile:
[methods] No changes to PApplet API. [javac] Compiling 33 source files to /home/foo/processing-read-only/processing/core/bin [javac] /home/foo/processing-read-only/processing/core/src/processing/core/PImage.java:3094: warning: com.sun.image.codec.jpeg.JPEGImageEncoder is Sun proprietary API and may be removed in a future release [javac] JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output); [javac] ^ [javac] /home/foo/processing-read-only/processing/core/src/processing/core/PImage.java:3094: warning: com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and may be removed in a future release [javac] JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output); [javac] ^ [javac] /home/foo/processing-read-only/processing/core/src/processing/core/PImage.java:3095: warning: com.sun.image.codec.jpeg.JPEGEncodeParam is Sun proprietary API and may be removed in a future release [javac] JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bimage); [javac] ^ [javac] Note: /home/foo/processing-read-only/processing/core/src/processing/core/PGraphicsJava2D.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 3 warnings [copy] Copying 1 file to /home/foo/processing-read-only/processing/core/bin/japplemenubar [copy] Copying 16 files to /home/foo/processing-read-only/processing/core/bin
But the build also fails with oracle jdk-1.7.0_09 (shouldn't be too surprised about that though, as it is based on openjdk). See error messages below:-
compile:
[methods] No changes to PApplet API. [mkdir] Created dir: /home/tux/processing-read-only/processing/core/bin [javac] Compiling 33 source files to /home/tux/processing-read-only/processing/core/bin [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6 [javac] /home/tux/processing-read-only/processing/core/src/processing/core/PImage.java:32: error: package com.sun.image.codec.jpeg does not exist [javac] import com.sun.image.codec.jpeg.*; [javac] ^ [javac] /home/tux/processing-read-only/processing/core/src/processing/core/PImage.java:3094: error: cannot find symbol [javac] JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output); [javac] ^ [javac] symbol: class JPEGImageEncoder [javac] location: class PImage [javac] /home/tux/processing-read-only/processing/core/src/processing/core/PImage.java:3094: error: cannot find symbol [javac] JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output); [javac] ^ [javac] symbol: variable JPEGCodec [javac] location: class PImage [javac] /home/tux/processing-read-only/processing/core/src/processing/core/PImage.java:3095: error: cannot find symbol [javac] JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bimage); [javac] ^ [javac] symbol: class JPEGEncodeParam [javac] location: class PImage [javac] Note: /home/tux/processing-read-only/processing/core/src/processing/core/PGraphicsJava2D.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 4 errors [javac] 1 warning
Original issue: http://code.google.com/p/processing/issues/detail?id=1424
Why are you using classes in the package com.sun.image.codec.jpeg? You are not supposed to use those classes directly:.What does your program do?
Does it just try to read or write a JPG image? That's very easy with the ImageIO API. See this tutorial:.Addition - The package com.sun.image.codec.jpeg has been removed in Java 7 as mentioned in the.Synopsis: The Non-standard com.sun.image.codec.jpeg Package is RetiredDescription: The com.sun.image.codec.jpeg package was added in JDK 1.2 (Dec 1998) as a non-standard way of controlling the loading and saving of JPEG format image files. This package was never part of the platform specification and it has been removed from the Java SE 7 release. The Java Image I/O API was added to the JDK 1.4 release as a standard API and eliminated the need for the com.sun.image.codec.jpeg package. Which JDK are you using?
I think that this package is not a requirement and will only be available in Sun's JDK. Explains.You may be able to download the jar file and include it on your path file separately if you really want to use it though.According to:Note that the classes in the com.sun.image.codec.jpeg package are not part of the core Java APIs. They are a part of Sun's JDK and JRE distributions. Although other licensees may choose to distribute these classes, developers cannot depend on their availability in non-Sun implementations. We expect that equivalent functionality will eventually be available in a core API or standard extension.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |