Strange difference between Java 8 and 6 under OSX

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

Strange difference between Java 8 and 6 under OSX

lechristophe
Hi,

I just noticed something strange. I'm running exactly the same Fiji setup
on two Mac computers (it is mirrored between the two), but one uses Java 8
and the other one Java 6 (latest versions, both under Yosemite).

I have a javascript that contains a string split using the string "][".

Under Java 8, I have to escape the characters like this to make it work:
"\\]\\["
Under Java 6, I have to modify my script and use "\]\["

Is there some reason for this discrepancy? I'd like my script to be immune
to which Java people use.

Thanks for your help,

Christophe

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

Re: Strange difference between Java 8 and 6 under OSX

Alexandre Dufour
Hi Christophe,

I've had the same issue, only to realize that Java 8 has changed the way strings are parsed. This is a non backward compatible change, and is quite annoying indeed. Whichever code you use will first have to check the Java version before choosing which string to parse...

Alexandre

> On 18 juil. 2015, at 14:56, Christophe Leterrier <[hidden email]> wrote:
>
> Hi,
>
> I just noticed something strange. I'm running exactly the same Fiji setup
> on two Mac computers (it is mirrored between the two), but one uses Java 8
> and the other one Java 6 (latest versions, both under Yosemite).
>
> I have a javascript that contains a string split using the string "][".
>
> Under Java 8, I have to escape the characters like this to make it work:
> "\\]\\["
> Under Java 6, I have to modify my script and use "\]\["
>
> Is there some reason for this discrepancy? I'd like my script to be immune
> to which Java people use.
>
> Thanks for your help,
>
> Christophe
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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