Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

Stein Rørvik
Hello,

I just downloaded a fresh copy of the official stable version of ImageJ (version 1.50i) bundled with 64-bit Java 1.6.0_24
from http://wsr.imagej.net/distros/win/ij150-win-jre6.zip

Then I tried to compile a small plugin I wrote myself. I got a message that I needed to download Compiler.jar, so I said yes.

Then I get this error message, and the attempt to compile the plugin halts:

                ImageJ 1.50i; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 16MB of 9121MB (<1%)

                java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0

                This plugin requires Java 1.8 or later.

Obviously, the latest version of Compiler.jar is not compatible with Java 1.6.

I looked in the plugins directory on the website and tried to download Compiler.jar from

                https://imagej.nih.gov/ij/plugins/compiler/

but the problem is the same. The above link seems to point to the same non-working version ImageJ itself downloaded.

Then I tried to copy Compiler.jar from my previous installation of ImageJ 1.5x to the plugin/jars folder and then everything worked as it should. The working Compiler.jar (compatible with java 1.6) has a file date 2015-06-26 (probably meaning that I installed it on that day) and a filesize 1063375 bytes. My previous installation was updated continuously since v1.49, so several files were inherited from the older versions.

So, what is the proper way to deal with this issue?
Upgrading to the latest version of 1.51x does not help.
I do not want to use Java 1.8 because the 3D Viewer does not work with that.

The workaroud for me (transfering an old version of the jar file) worked well, but the problem is that I need to distribute the plugin code for someone else to compile, and cannot send them the compatible Compiler.jar as an email attachement since our company security policy blocks any attempt on emailing .jar files.

Perhaps a version of Compiler.jar compatible with Java 1.6 should have been included in the ij150-win-jre6.zip file?
It seems that a Java 1.6 compatible version of Compiler.jar was included in ij149-jre6-64.zip.

Stein

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

ctrueden
Hi Stein,

>  I need to distribute the plugin code for someone else to compile

Java is "write once, run anywhere"—would it work to simply send them the
compiled version as a .jar or .class?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Wed, Apr 5, 2017 at 11:42 AM, Stein Rørvik <[hidden email]>
wrote:

> Hello,
>
> I just downloaded a fresh copy of the official stable version of ImageJ
> (version 1.50i) bundled with 64-bit Java 1.6.0_24
> from http://wsr.imagej.net/distros/win/ij150-win-jre6.zip
>
> Then I tried to compile a small plugin I wrote myself. I got a message
> that I needed to download Compiler.jar, so I said yes.
>
> Then I get this error message, and the attempt to compile the plugin halts:
>
>                 ImageJ 1.50i; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 16MB
> of 9121MB (<1%)
>
>                 java.lang.UnsupportedClassVersionError:
> com/sun/tools/javac/Main : Unsupported major.minor version 52.0
>
>                 This plugin requires Java 1.8 or later.
>
> Obviously, the latest version of Compiler.jar is not compatible with Java
> 1.6.
>
> I looked in the plugins directory on the website and tried to download
> Compiler.jar from
>
>                 https://imagej.nih.gov/ij/plugins/compiler/
>
> but the problem is the same. The above link seems to point to the same
> non-working version ImageJ itself downloaded.
>
> Then I tried to copy Compiler.jar from my previous installation of ImageJ
> 1.5x to the plugin/jars folder and then everything worked as it should. The
> working Compiler.jar (compatible with java 1.6) has a file date 2015-06-26
> (probably meaning that I installed it on that day) and a filesize 1063375
> bytes. My previous installation was updated continuously since v1.49, so
> several files were inherited from the older versions.
>
> So, what is the proper way to deal with this issue?
> Upgrading to the latest version of 1.51x does not help.
> I do not want to use Java 1.8 because the 3D Viewer does not work with
> that.
>
> The workaroud for me (transfering an old version of the jar file) worked
> well, but the problem is that I need to distribute the plugin code for
> someone else to compile, and cannot send them the compatible Compiler.jar
> as an email attachement since our company security policy blocks any
> attempt on emailing .jar files.
>
> Perhaps a version of Compiler.jar compatible with Java 1.6 should have
> been included in the ij150-win-jre6.zip file?
> It seems that a Java 1.6 compatible version of Compiler.jar was included
> in ij149-jre6-64.zip.
>
> Stein
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

Stein Rørvik
Yes of course, but as I wrote the problem is that any attempt on passing .jar .class or .zip files as email attachments has failed due to a strict security policy; renaming the extensions does not work. Pasting the source code as plaintext in an email is therefore the preferred approach, with the benefit that the recipient can then see the code and learn how plugins in ImageJ works.

Stein

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Curtis Rueden
Sent: 05. april 2017 20:47
To: [hidden email]
Subject: Re: Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

Hi Stein,

>  I need to distribute the plugin code for someone else to compile

Java is "write once, run anywhere"—would it work to simply send them the compiled version as a .jar or .class?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden Did you know ImageJ has a forum? http://forum.imagej.net/


On Wed, Apr 5, 2017 at 11:42 AM, Stein Rørvik <[hidden email]>
wrote:

> Hello,
>
> I just downloaded a fresh copy of the official stable version of
> ImageJ (version 1.50i) bundled with 64-bit Java 1.6.0_24 from
> http://wsr.imagej.net/distros/win/ij150-win-jre6.zip
>
> Then I tried to compile a small plugin I wrote myself. I got a message
> that I needed to download Compiler.jar, so I said yes.
>
> Then I get this error message, and the attempt to compile the plugin halts:
>
>                 ImageJ 1.50i; Java 1.6.0_24 [64-bit]; Windows 7 6.1;
> 16MB of 9121MB (<1%)
>
>                 java.lang.UnsupportedClassVersionError:
> com/sun/tools/javac/Main : Unsupported major.minor version 52.0
>
>                 This plugin requires Java 1.8 or later.
>
> Obviously, the latest version of Compiler.jar is not compatible with
> Java 1.6.
>
> I looked in the plugins directory on the website and tried to download
> Compiler.jar from
>
>                 https://imagej.nih.gov/ij/plugins/compiler/
>
> but the problem is the same. The above link seems to point to the same
> non-working version ImageJ itself downloaded.
>
> Then I tried to copy Compiler.jar from my previous installation of
> ImageJ 1.5x to the plugin/jars folder and then everything worked as it
> should. The working Compiler.jar (compatible with java 1.6) has a file
> date 2015-06-26 (probably meaning that I installed it on that day) and
> a filesize 1063375 bytes. My previous installation was updated
> continuously since v1.49, so several files were inherited from the older versions.
>
> So, what is the proper way to deal with this issue?
> Upgrading to the latest version of 1.51x does not help.
> I do not want to use Java 1.8 because the 3D Viewer does not work with
> that.
>
> The workaroud for me (transfering an old version of the jar file)
> worked well, but the problem is that I need to distribute the plugin
> code for someone else to compile, and cannot send them the compatible
> Compiler.jar as an email attachement since our company security policy
> blocks any attempt on emailing .jar files.
>
> Perhaps a version of Compiler.jar compatible with Java 1.6 should have
> been included in the ij150-win-jre6.zip file?
> It seems that a Java 1.6 compatible version of Compiler.jar was
> included in ij149-jre6-64.zip.
>
> Stein
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile plugins with ImageJ 1.5x and Java 1.6 on windows

Wayne Rasband-2
In reply to this post by Stein Rørvik
> On Apr 5, 2017, at 12:42 PM, Stein Rørvik <[hidden email]> wrote:
>
> Hello,
>
> I just downloaded a fresh copy of the official stable version of ImageJ (version 1.50i) bundled with 64-bit Java 1.6.0_24
> from http://wsr.imagej.net/distros/win/ij150-win-jre6.zip
>
> Then I tried to compile a small plugin I wrote myself. I got a message that I needed to download Compiler.jar, so I said yes.
>
> Then I get this error message, and the attempt to compile the plugin halts:

There is now an updated version of the Windows distribution at
   
      http://wsr.imagej.net/distros/win/ij150-win-jre6.zip

that includes a version of Compiler.jar compatible with Java 6.

-wayne


>               ImageJ 1.50i; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 16MB of 9121MB (<1%)
>
>                java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
>
>                This plugin requires Java 1.8 or later.
>
> Obviously, the latest version of Compiler.jar is not compatible with Java 1.6.
>
> I looked in the plugins directory on the website and tried to download Compiler.jar from
>
>                https://imagej.nih.gov/ij/plugins/compiler/
>
> but the problem is the same. The above link seems to point to the same non-working version ImageJ itself downloaded.
>
> Then I tried to copy Compiler.jar from my previous installation of ImageJ 1.5x to the plugin/jars folder and then everything worked as it should. The working Compiler.jar (compatible with java 1.6) has a file date 2015-06-26 (probably meaning that I installed it on that day) and a filesize 1063375 bytes. My previous installation was updated continuously since v1.49, so several files were inherited from the older versions.
>
> So, what is the proper way to deal with this issue?
> Upgrading to the latest version of 1.51x does not help.
> I do not want to use Java 1.8 because the 3D Viewer does not work with that.
>
> The workaroud for me (transfering an old version of the jar file) worked well, but the problem is that I need to distribute the plugin code for someone else to compile, and cannot send them the compatible Compiler.jar as an email attachement since our company security policy blocks any attempt on emailing .jar files.
>
> Perhaps a version of Compiler.jar compatible with Java 1.6 should have been included in the ij150-win-jre6.zip file?
> It seems that a Java 1.6 compatible version of Compiler.jar was included in ij149-jre6-64.zip.
>
> Stein

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Loading...