Compiling ImageJ under OpenJDK

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling ImageJ under OpenJDK

Ben Gamari
Hey all,

I just tried compiling ImageJ on Fedora with OpenJDK and encountered
numerous errors of several varieties as well as nearly eight-hundred
(fairly innocuous looking) warnings. It seems like a large number of the
errors seems to revolve around the deprecated com.sun.image.codec.jpeg
package. I have included the errors below. Thanks,

- Ben


    [javac] ----------
    [javac] 1. ERROR in /home/ben/source/ij/io/ImageReader.java (at line 7)
    [javac]     import com.sun.image.codec.jpeg.*;
    [javac]            ^^^^^^^^^^^^^
    [javac] The import com.sun.image cannot be resolved
    [javac] ----------
    [javac] 2. ERROR in /home/ben/source/ij/io/ImageReader.java
    [javac]  (at line 418)
    [javac]     BufferedImage bi = JPEGCodec.createJPEGDecoder(in).decodeAsBufferedImage();
    [javac]                        ^^^^^^^^^
    [javac] JPEGCodec cannot be resolved
    [javac] ----------
    [javac] ----------
    [javac] 3. ERROR in /home/ben/source/ij/plugin/AVI_Reader.java
    [javac]  (at line 11)
    [javac]     import com.sun.image.codec.jpeg.*;
    [javac]            ^^^^^^^^^^^^^
    [javac] The import com.sun.image cannot be resolved
    [javac] ----------
    [javac] ----------
    [javac] 9. ERROR in /home/ben/source/ij/plugin/AVI_Reader.java
    [javac]  (at line 732)
    [javac]     bi = JPEGCodec.createJPEGDecoder(inputStream).decodeAsBufferedImage();
    [javac]          ^^^^^^^^^
    [javac] JPEGCodec cannot be resolved
    [javac] ----------
    [javac] ----------
    [javac] 12. ERROR in /home/ben/source/ij/plugin/Compiler.java
    [javac]  (at line 99)
    [javac]     boolean compiled = javac.compile(arguments, new PrintWriter(output))==0;
    [javac]                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] Unhandled exception type Exception
    [javac] ----------
    [javac] ----------
    [javac] 14. ERROR in /home/ben/source/ij/plugin/filter/AVI_Writer.java
    [javac]  (at line 11)
    [javac]     import com.sun.image.codec.jpeg.*;
    [javac]            ^^^^^^^^^^^^^
    [javac] The import com.sun.image cannot be resolved
    [javac] ----------
    [javac] 15. ERROR in /home/ben/source/ij/plugin/filter/AVI_Writer.java
    [javac]  (at line 54)
    [javac]     private JPEGImageEncoder jpegEncoder;
    [javac]             ^^^^^^^^^^^^^^^^
    [javac] JPEGImageEncoder cannot be resolved to a type
    [javac] ----------
    [javac] ----------
    [javac] 17. ERROR in /home/ben/source/ij/plugin/filter/AVI_Writer.java
    [javac]  (at line 371)
    [javac]     jpegEncoder = JPEGCodec.createJPEGEncoder(raOutputStream);
    [javac]     ^^^^^^^^^^^
    [javac] JPEGImageEncoder cannot be resolved to a type
    [javac] ----------
    [javac] 18. ERROR in /home/ben/source/ij/plugin/filter/AVI_Writer.java
    [javac]  (at line 371)
    [javac]     jpegEncoder = JPEGCodec.createJPEGEncoder(raOutputStream);
    [javac]                   ^^^^^^^^^
    [javac] JPEGCodec cannot be resolved
    [javac] ----------
    [javac] 19. ERROR in /home/ben/source/ij/plugin/filter/AVI_Writer.java
    [javac]  (at line 372)
    [javac]     jpegEncoder.encode(bufferedImage);  
    [javac]     ^^^^^^^^^^^
    [javac] JPEGImageEncoder cannot be resolved to a type
    [javac] ----------
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

Paolo Ariano
Il giorno mar, 30/09/2008 alle 15.58 -0400, Ben Gamari ha scritto:
> Hey all,
>
> I just tried compiling ImageJ on Fedora with OpenJDK and encountered
> numerous errors of several varieties as well as nearly eight-hundred
> (fairly innocuous looking) warnings. It seems like a large number of the
> errors seems to revolve around the deprecated com.sun.image.codec.jpeg
> package. I have included the errors below. Thanks,

there was a thread dated 23 sept 2008 about imagej and openjdk ...

it was a problem about jpeg BUT the happy conclusion was from Wayne
announcing that "Starting with v1.41n, ImageJ saves JPEGs using ImageIO
if the ij.plugin.JpegWriter class is missing. Removing this class should
allow you to compile ImageJ with OpenJDK."

on my debian it compile without any problem, and i hope the next week
the new imagej, compiled with openidk will be in debian/main maybe you
cand make a deb2rpm

hth
paolo

--
NeuroScience PhD
Post-doc @ University of Torino
www.personalweb.unito.it/paolo.ariano
www.cellular-neurophysiology.unito.it
www.mieleria.it
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

dscho
In reply to this post by Ben Gamari
Hi,

On Tue, 30 Sep 2008, Ben Gamari wrote:

> I just tried compiling ImageJ on Fedora with OpenJDK and encountered
> numerous errors of several varieties as well as nearly eight-hundred
> (fairly innocuous looking) warnings. It seems like a large number of the
> errors seems to revolve around the deprecated com.sun.image.codec.jpeg
> package. I have included the errors below. Thanks,

So what do you propose?  Remove the Jpeg support code?  I hope not.

Ciao,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

Ben Gamari
In reply to this post by Paolo Ariano
Paolo Ariano wrote:

> Il giorno mar, 30/09/2008 alle 15.58 -0400, Ben Gamari ha scritto:
>  
>> Hey all,
>>
>> I just tried compiling ImageJ on Fedora with OpenJDK and encountered
>> numerous errors of several varieties as well as nearly eight-hundred
>> (fairly innocuous looking) warnings. It seems like a large number of the
>> errors seems to revolve around the deprecated com.sun.image.codec.jpeg
>> package. I have included the errors below. Thanks,
>>    
>
> there was a thread dated 23 sept 2008 about imagej and openjdk ...
>
> it was a problem about jpeg BUT the happy conclusion was from Wayne
> announcing that "Starting with v1.41n, ImageJ saves JPEGs using ImageIO
> if the ij.plugin.JpegWriter class is missing. Removing this class should
> allow you to compile ImageJ with OpenJDK."
>
> on my debian it compile without any problem, and i hope the next week
> the new imagej, compiled with openidk will be in debian/main maybe you
> cand make a deb2rpm
>
> hth
> paolo
>
>  
Yes, I saw that thread. Unfortunately, my problems seem to far broader
than yours were. Perhaps the most troubling of these is #12, "Unhandled
exception type Exception." As a programmer (although admittedly with
relatively little experience with Java, I honestly don't know what to
make of this. It definitely seems as if we should find (or begin
writing) a new JPEG library for ImageJ. Using deprecated APIs just isn't
a realistic way forward. Is there any reason why javax.imageio couldn't
be used throughout ImageJ? Thanks,

- Ben
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

Paolo Ariano
Il giorno mer, 01/10/2008 alle 09.24 -0400, Ben Gamari ha scritto:
> Yes, I saw that thread. Unfortunately, my problems seem to far broader
> than yours were. Perhaps the most troubling of these is #12, "Unhandled
> exception type Exception." As a programmer (although admittedly with
> relatively little experience with Java, I honestly don't know what to
> make of this. It definitely seems as if we should find (or begin
> writing) a new JPEG library for ImageJ. Using deprecated APIs just isn't
> a realistic way forward. Is there any reason why javax.imageio couldn't
> be used throughout ImageJ? Thanks,

if i well understood
http://rsb.info.nih.gov/ij/download/src/ij41n-src.zip
solves jpeg problems, for the others really don't know
hth
paolo
--
NeuroScience PhD
Post-doc @ University of Torino
www.personalweb.unito.it/paolo.ariano
www.cellular-neurophysiology.unito.it
www.mieleria.it
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

Ben Gamari
Paolo Ariano wrote:

> Il giorno mer, 01/10/2008 alle 09.24 -0400, Ben Gamari ha scritto:
>  
>> Yes, I saw that thread. Unfortunately, my problems seem to far broader
>> than yours were. Perhaps the most troubling of these is #12, "Unhandled
>> exception type Exception." As a programmer (although admittedly with
>> relatively little experience with Java, I honestly don't know what to
>> make of this. It definitely seems as if we should find (or begin
>> writing) a new JPEG library for ImageJ. Using deprecated APIs just isn't
>> a realistic way forward. Is there any reason why javax.imageio couldn't
>> be used throughout ImageJ? Thanks,
>>    
>
> if i well understood
> http://rsb.info.nih.gov/ij/download/src/ij41n-src.zip
> solves jpeg problems, for the others really don't know
> hth
> paolo
>  
http://rsb.info.nih.gov/ij/download/src/ij141n-src.zip. Yes, this was
the source tree I was attempting to build. Does anyone else have any
ideas? The javac.compile issue is extremely perplexing. Thanks,

- Ben
Reply | Threaded
Open this post in threaded view
|

Re: Compiling ImageJ under OpenJDK

Paolo Ariano
Il giorno mer, 01/10/2008 alle 10.51 -0400, Ben Gamari ha scritto:
> http://rsb.info.nih.gov/ij/download/src/ij141n-src.zip. Yes, this was
> the source tree I was attempting to build. Does anyone else have any
> ideas? The javac.compile issue is extremely perplexing. Thanks,

last try, if i use:
ant -f build.xml

i obtain:

paolinux@GiBo:source$ ant -f build.xml
Buildfile: build.xml

compile:
    [mkdir] Created dir: /home/paolinux/Desktop/pippo/source/build
    [javac] Compiling 257 source files
to /home/paolinux/Desktop/pippo/source/build

[javac] /home/paolinux/Desktop/pippo/source/ij/plugin/filter/AVI_Writer.java:54: warning: com.sun.image.codec.jpeg.JPEGImageEncoder is Sun proprietary API and may be removed in a future release
    [javac]     private JPEGImageEncoder jpegEncoder;
    [javac]             ^

[javac] /home/paolinux/Desktop/pippo/source/ij/io/ImageReader.java:418:
warning: com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and
may be removed in a future release
    [javac] BufferedImage bi =
JPEGCodec.createJPEGDecoder(in).decodeAsBufferedImage();
    [javac]                   ^

[javac] /home/paolinux/Desktop/pippo/source/ij/plugin/AVI_Reader.java:732: warning: com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and may be removed in a future release
    [javac]             bi =
JPEGCodec.createJPEGDecoder(inputStream).decodeAsBufferedImage();
    [javac]                  ^

[javac] /home/paolinux/Desktop/pippo/source/ij/plugin/filter/AVI_Writer.java:371: warning: com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and may be removed in a future release
    [javac]             jpegEncoder =
JPEGCodec.createJPEGEncoder(raOutputStream);
    [javac]                           ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 warnings

build:
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo/source/build
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo/source/build
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo/source/build
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo/source/build
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo/source/build
     [copy] Copying 12 files
to /home/paolinux/Desktop/pippo/source/build/macros
      [jar] Building jar: /home/paolinux/Desktop/pippo/source/ij.jar

run:
     [copy] Copying 1 file to /home/paolinux/Desktop/pippo

BUILD SUCCESSFUL
Total time: 10 seconds


and i'm sure i'm using openjdk-6-jdk (i don't have sun-jdk) are you
sure ? Maybe you could try ti force your JAVA_HOME or JAVA_CMD to not
use gcj ...

set JAVA_HOME:=/usr/sbin/update-java-alternatives -l | grep -vw sun |
head -1 | cut -d' ' -f 3

just to understand that is not a imagej's source problem or a
openjdk-6-jdk problem but maybe the command line you type ora a fedora
configuration

hth
paolo


--
NeuroScience PhD
Post-doc @ University of Torino
www.personalweb.unito.it/paolo.ariano
www.cellular-neurophysiology.unito.it
www.mieleria.it