So far, I exectuted my jython plugins from the script editor in Fiji. I would like to execute my jython scripts from in the command line.
When executing jython myscript.py
at the line
from ij import IJ
I get the error:
ImportError: No module named ij
I guess it means that the jar file of ij can’t be found, as it usually was found by the ImageJ editor.
So I set the java classpath:
java -cp “/home/user/input_bash/jars/ij.jar” ij
Then I am getting the error:
Main class not found. (Fehler: Hauptklasse ij konnte nicht gefunden oder geladen werden) Cause: java.lang.ClassNotFoundException: ij
I am new to java, does that mean I am not working with the right jars?
I also used the editor to execute:
from ij import IJ;
print(IJ.getClassLoader().loadClass("ij.IJ")
.getResource("IJ.class").toString());
Which gives me the directory: /home/user/Software/Fiji.app/jars/ij-1.53c.jar!/ij/IJ.class
This means the editor uses the class inside ij-1.53c.jar!
Then I tried:
java -cp "/home/lisa/Software/Fiji.app/jars/ij-1.53c.jar\!/ij" ij
with an additional \
due to the !
.
I am still getting the same classNotFoundException
.