Posted by
David Pirotte on
Aug 12, 2013; 6:38pm
URL: http://imagej.273.s1.nabble.com/ij-48-a-jar-Exception-in-thread-main-java-lang-NoSuchMethodError-ij-Menus-getImageJPath-Ljava-lang-S-tp5004403.html
Hello,
The following clojure code [see the watershed.clj script below] used to perfectly work until ij-1.47.m.jar
-] I have just updated our fiji/imagej to the very latest available version of imagej and fiji
-] now i run ij-1.48a.jar
Since this update, i get this error [see below as well]. Any one could kindly tell me what the problem is?
Many thanks,
David
1] this is how I execute the clojure script [I did install clojure-1.4.jar manually]
cd /usr/local/src/Fiji.app/jars; java -cp clojure-1.4.0.jar:headless.jar:ij-1.47m.jar:ij-1.48a.jar clojure.main /usr/lpdi/projects/clojure/watershed/watershed.clj /tmp/CPOL_60.png.noise-0.0.threhold-0.032 CPOL_60_seeds png
2] here is the error message
Exception in thread "main" java.lang.NoSuchMethodError: ij.Menus.getImageJPath()Ljava/lang/String;
at ij.Prefs.getImageJDir(Prefs.java:234)
at ij.IJ.getDirectory(IJ.java:1479)
at ij.Menus.addLuts(Menus.java:333)
at ij.Menus.addSubMenu(Menus.java:328)
at ij.Menus.getMenu(Menus.java:698)
at ij.Menus.addMenuBar(Menus.java:169)
at ij.IJ.init(IJ.java:326)
at ij.IJ.run(IJ.java:253)
at ij.IJ.run(IJ.java:317)
at user$eval5.invoke(watershed.clj:16)
at clojure.lang.Compiler.eval(Compiler.java:6514)
at clojure.lang.Compiler.load(Compiler.java:6955)
at clojure.lang.Compiler.loadFile(Compiler.java:6915)
at clojure.main$load_script.invoke(main.clj:283)
at clojure.main$script_opt.invoke(main.clj:343)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:427)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
3] here is th watershed.clj script
(import '(ij IJ)
'(ij ImagePlus))
(let [args *command-line-args*
its-length (count args)]
(if (= its-length 3)
(let [d-name (nth args 0)
f-name (nth args 1)
f-ext (nth args 2)
filename (str d-name "/" f-name "." f-ext)
wsfilename (str d-name "/" f-name ".ws." f-ext)
imp (IJ/openImage filename)]
(IJ/run imp "8-bit" "")
(IJ/run imp "Watershed", "")
(IJ/save imp wsfilename)
(System/exit 0))
(do
(println "ERROR: watershed.clj, wrong number of arguments")
(System/exit -1))))
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html