-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the ScriptEditor uses the proper javac? #119
Comments
|
The script editor calls javac from the If you wish, you could try removing tools.jar and ensure the version of Java you're using is a JDK, not just a JRE... then let us know if you manage to get it working. It would be awesome to have a FAQ entry on the subject at http://imagej.net/FAQ. |
|
Hey Curstis, i removed tools-1.4.2.jar and this is the result |
|
OK, so maybe my theory is wrong then. I don't know. If you figure it out, definitely let us know, and/or write a FAQ entry. It would benefit an increasing number of people, as more installations migrate to Java 8. Unfortunately, I don't have time to look into it myself right now. But I will later this year—for a variety of reasons, this is very likely the year that ImageJ2 will switch to Java 8 and Java 3D 1.6... |
|
Another try on this: I got rid of javac-1.6.0.24-ubuntu-fiji2.jar of my jars folder and tried using the script editor to compile my java plugin with the java8 dependency (another jar build with java8). Console: Script editor |
|
Another Test:
gave me this There is no jre folder in java_home anymore. Maybe I can find the culprit somewhere in the sources. |
|
Success (on Mac OS 10.9): -copy my Java8 based dependency to Fiji.app/plugins Although it looks like a failure. ImageJ picks up the javac from the $PATH, compiles the stuff and runs my plugin. Even the export as .jar works fine. @ctrueden and @hinerm: It's up to you, to close this issue. I would leave it open, because for an average user this approach seems not very elegant. |
|
Thanks for all the information, @StephanJanosch! We should definitely leave this issue open, since we want the compilation to work "out of the box" with whatever version of Java is being used to run ImageJ itself. And there should never be a need to set or alter any environment variables. We do have plans to make this work—it is just a matter of time. |
|
@StephanJanosch No rush, but when you get a chance, can you please test with the latest Fiji, with the Java-8 update site enabled? Note that you will need to be using Java 8 before enabling this update site, for your installation to continue working. See this news post for some details. We may also still need to mark the javac component as obsolete on the Java-8 update site. (IIRC we didn't yet.) |
|
I get the same error message about Object, got version 52, wants version 50, here is how: so if its using the java compiler of java version 1.6 from tools.jar and but running java 1.8, of course it cant works. This is nasty for a user running plugins from .java source code when they switch to java 1.8. The easy work around is to use precompiled .class files put in the plugins directory. That just works... so long as there is a .class file to download for the plugin.... lucky for me there was. |
|
@chalkie666 Compiling Java code in the Script Editor will only work with Java 8 if:
I want to mark those files obsolete on the Java-8 update site, but due to a bug in the Updater, cannot currently do so. |
|
I am going to go ahead and remove those files from the core ImageJ and Fiji update sites. That way, with the Java-8 site enabled, Java coding will work in the Script Editor out of the box—meaning that Java coding will work with fresh downloads of Fiji again. People who have not upgraded beyond Java 6 will lose the ability to compile Java code in the Script Editor. But I see no way around that, without extending the Updater to support obsoleting a file in a downstream update site (it currently has no support for this). |
|
I removed those two files. Actually, Java compilation now works in Fiji even without the Java-8 update site enabled, as long as the installation is using Java 8. (I did not test with Java 6, but I am guessing it probably does not work.) As a side effect, we are now closer to a legal software distribution—it was not kosher to be distributing the |
I open fiji like this:
I need Java 8, because I have an external lib build with Java 8.
Now I am creating a plugin and want to compile it and get errors
Now I wonder, if the script editor uses the javac specified in Fiji call.
I know, that my stuff works, because I can compile it outside Fiji and copy the class file over. It looks like that the built-in javac is called, as this poor guy is still Java6 and cannot read jars made by Java8(class file version 52).
Any thoughts?
And Thanks!
The text was updated successfully, but these errors were encountered: