title: Why does the conversion of Dicom file into a JPEG image fail with dcm4che 2.0.29?
body: <p>I'm trying to use dcm4che (recent version 2.0.29) in a new DICOM project.
  I got the following error trying to convert a DICOM file into jpeg.
  I was unable to find the jar file containing the  com.sun.medialib.codec.jpeg.Decoder class. 
  Can anyone give me an idea where can I find it?</p>
  
  <p>I installed jai 1.1.2.01 (lastest version found in oracle's download page)
  I probed it with java 6, 7 and 8.</p>
  
  <p>Here my code:</p>
  
  <pre><code>    public static void main(String[] args) {
      try {
  
          //com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader
          //com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader
  
          ImageIO.scanForPlugins();
          IIORegistry reg = IIORegistry.getDefaultInstance();
          reg.registerApplicationClasspathSpis();
  
          CLibJPEGImageReaderSpi prov = new com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi();
          System.out.println("prov: "+prov.getClass().getName());
          System.out.println("prov: "+prov.getPluginClassName()+" ("+prov.getDescription(Locale.US)+")");
          for (String t:prov.getMIMETypes()){
              System.out.println("MIME: "+t);
          }
          reg.registerServiceProvider(prov, ImageReaderSpi.class);
          Dcm2Jpg dcm2jpg=new Dcm2Jpg();
  
          File origen=new File("c:/tmp/dicom/2.25.140624125599408099713879344899488955633.dcm");
          File destino=new File("c:/tmp/dicom/prueba.jpg");
          dcm2jpg.convert(origen, destino);
  </code></pre>
  
  <p>And here console output:</p>
  
  <pre><code>javax.imageio.IIOException: codecLib error
  at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader.getInfoImage(CLibJPEGImageReader.java:207)
  at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader.getImageTypes(CLibJPEGImageReader.java:274)
  at javax.imageio.ImageReader.getRawImageType(ImageReader.java:665)
  at com.sun.media.imageioimpl.plugins.clib.CLibImageReader.read(CLibImageReader.java:571)
  at org.dcm4che2.imageioimpl.plugins.dcm.DicomImageReader.read(DicomImageReader.java:778)
  at org.dcm4che2.tool.dcm2jpg.Dcm2Jpg.convert(Dcm2Jpg.java:175)
  at es.cimkey.dicomclient.DicomClient.main(DicomClient.java:94)
  Caused by: java.lang.NoClassDefFoundError: com/sun/medialib/codec/jpeg/Decoder
      at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader.getInfoImage(CLibJPEGImageReader.java:199)
      ... 6 more
  Caused by: java.lang.ClassNotFoundException: com.sun.medialib.codec.jpeg.Decoder
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
  ... 7 more
  </code></pre>