|
Bugzilla – Bug 776 |
jruby integration is broken |
Last modified: 2014-08-28 08:44:49 CDT |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
Johannes pointed out to me that the following works: java_import "ij.IJ" IJ.log("Hello") So, you can certainly access the ij.* classes (or whatever Java classes) in this way. Does that address your concern with "ij" etc.? Or are we missing something? The bug with print echoing to the system console instead of the Script Editor console is real, and we'll need to fix it.In the meantime, in the case you want to circumvent this bug, you can define your own ij method simply by putting these lines in the beginning of your script: def ij Java::Ij end And if you require stdout, like mentioned before, IJ.log is working: def print *args ij.IJ.log args.join($, || "") end def puts *args ij.IJ.log args.join("\n") end> Sorry, I don't really understand the reason behind this ImageJ 1.x classes are the vast minority of classes in Fiji by now. If you want to use, say, the classes of the Volume Viewer all the time, you will notice that there is a class called "Line" in the "volumeviewer" package. The same name is used by a class in ij.gui of ImageJ 1.x. You cannot import both. The way Mark handled the situation solves the problem. If you feel you can do better, feel free to submit a pull request with an alternative solution that we will then scrutinize with respect to existing setups that we try not to break.