compiling problems Java 8 and string manipulation

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

compiling problems Java 8 and string manipulation

jvander
Hello,

I have been compiling plugins on a Mac running 10.6.8 with Java 1.6.0_65 from Apple.  I just bought a 10.10.4 Mac and installed the experimental version ImageJ that comes with Java 8.

I am having problems compiling many of the plugins that compiled fine on the old system.

A first question - is how do I get the error log to show?  It either compiles or doesn't with no message.

The second question is specific.  Here is an example of simple string manipulation that works with the old but not with the new:
_________
String filename = "hello";
                IJ.showMessage("test","o" + filename);
_________

It should display "ohello" and does so on the old system, but refuses to compile on the new.  It will work if I do not try to concatenate the two strings with the + sign.  e.g  IJ.showMessage("test",filename); will produce "hello."

So where is my error message and does anyone have ideas on why concatenating strings with "+" works on the old and not the new?

thanks,

Joe v.

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

Re: compiling problems Java 8 and string manipulation

Rasband, Wayne (NIH/NIMH) [E]
> On Sep 7, 2015, at 2:39 PM, Joe Vandergracht <[hidden email]> wrote:
>
> Hello,
>
> I have been compiling plugins on a Mac running 10.6.8 with Java 1.6.0_65 from Apple.  I just bought a 10.10.4 Mac and installed the experimental version ImageJ that comes with Java 8.
>
> I am having problems compiling many of the plugins that compiled fine on the old system.
>
> A first question - is how do I get the error log to show?  It either compiles or doesn't with no message.
>
> The second question is specific.  Here is an example of simple string manipulation that works with the old but not with the new:
> _________
> String filename = "hello";
> IJ.showMessage("test","o" + filename);
> _________
>
> It should display "ohello" and does so on the old system, but ruses to compile on the new.  It will work if I do not try to concatenate the two strings with the + sign.  e.g  IJ.showMessage("test",filename); will produce "hello."
>
> So where is my error message and does anyone have ideas on why concatenating strings with "+" works on the old and not the new?

An updated Mac version of ImageJ bundled with Java 1.8.0_60 is now available that should work better. It compiles and runs the following test plugin without a problem.

-wayne

   import ij.*;
   import ij.plugin.*;
   public class My_Plugin implements PlugIn {
       public void run(String arg) {
           String filename = "hello";
           IJ.showMessage("test","o" + filename);
       }
   }

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

Re: compiling problems Java 8 and string manipulation

jvander
Wayne,

you wrote:
_______________
An updated Mac version of ImageJ bundled with Java 1.8.0_60 is now available that should work better. It compiles and runs the following test plugin without a problem.
_______________

Thanks for the information.  Rather than "re-install" can I just download and replace the ImageJ .jar file and/or download the latest java from Oracle ?

About ImageJ tells me that I have ImageJ 1.50a and Java 1.8.0_45 (64 bit)

The reason I ask is that I have some custom things in my ImageJ folder (mostly in the plugins folder) so I have to be careful when "reinstalling" to move all the right files.  It is not a huge problem and can certainly manage, but please advise if there is a simpler way.

thanks,

Joe v.