java compile error

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

java compile error

Dennis Christopher-2
Hello list members/programmers.

I have downloaded ImageJ 1.27t and sample plugin source. The latter used to compile
but now give me an error:

Error   : Invalid class file format: ij.plugin.filter.PlugInFilter, wrong version: 47, expected 45

I recenlty upgraded my OSX java environment to 1.41

Any enlightenment would be appreciated.

Dennis Christopher
Reply | Threaded
Open this post in threaded view
|

Re: java compile error

ctrueden
Hi Dennis,

Presumably you mean v1.37t, since that is the latest (v1.27 would be
very old). I'm not sure what you mean by "the latter used to compile"
-- did you compile the sample plugin using ImageJ's "compile and run"?

The wrong class version errors are indicative of a version mismatch
between the Java used to compile the source, and the Java running the
class. Specifically, the Java compiler used is newer than the runtime
environment being used to execute the program (and the newer Java
compiler was not instructed to target an older platform version).

Perhaps the ij.jar you have is compiled against Java 1.5 (but it
shouldn't be). At worst, you could download the latest available
ImageJ source code package and compile it yourself using your system's
Java compiler.

-Curtis

On 10/10/06, Dennis Christopher <[hidden email]> wrote:

> Hello list members/programmers.
>
> I have downloaded ImageJ 1.27t and sample plugin source. The latter used to compile
> but now give me an error:
>
> Error   : Invalid class file format: ij.plugin.filter.PlugInFilter, wrong version: 47, expected 45
>
> I recenlty upgraded my OSX java environment to 1.41
>
> Any enlightenment would be appreciated.
>
> Dennis Christopher
>
Reply | Threaded
Open this post in threaded view
|

Re: java compile error

Dennis Christopher-2
In reply to this post by Dennis Christopher-2
Thanks, Curtis.

(You are correct--I meant version 1.37t)

I am using an old version of Metrowerks CodeWarrior which I think
is just using the OSX system java compiler.

Should I try an older version of IJ.jar?

Dennis
Reply | Threaded
Open this post in threaded view
|

Re: java compile error

ctrueden
In reply to this post by Dennis Christopher-2
Hi Dennis,

I spoke to Wayne Rasband, and he indicated that class version 45
corresponds to Java 1.1, used by Mac OS 9 and the Classic environment
in OS X. Starting with v1.37, ImageJ is compiled against Java 1.3
(class version 47) instead of Java 1.1 like v1.36 and earlier. Thus,
if you need to run ImageJ with Java 1.1 (i.e., in the Classic
environment), you'll need to downgrade to ImageJ v1.36.

Wayne mentioned you might be using Codewarrior in the Classic
environment. I do not know much about Codewarrior, but a quick Google
search implies you can run Codewarrior under normal Mac OS X. If that
is not the case, I suggest looking into Apple's Xcode, about which
I've heard good things. (Or you could join the ranks of crazies like
me and try vim.)

If these details aren't in line with your environment, please reply to
the list with more information about your system configuration;
otherwise, it's all just speculation.

-Curtis

On 10/10/06, Dennis Christopher <[hidden email]> wrote:

> Hello list members/programmers.
>
> I have downloaded ImageJ 1.27t and sample plugin source. The latter used to compile
> but now give me an error:
>
> Error   : Invalid class file format: ij.plugin.filter.PlugInFilter, wrong version: 47, expected 45
>
> I recenlty upgraded my OSX java environment to 1.41
>
> Any enlightenment would be appreciated.
>
> Dennis Christopher
>
Reply | Threaded
Open this post in threaded view
|

Re: java compile error

Dennis Christopher-2
In reply to this post by Dennis Christopher-2
Thanks Curtis (and Wayne),

Metrowerks Codewarrior has been OSX native for quite a while now,
and I don't ever run Classic.

Nevertheless, CW must be using java1.1 since downgrading to ImageJ 1.36
solves the compile problem.

Dennis