Posted by
christophe leterrier on
Oct 25, 2005; 11:43am
URL: http://imagej.273.s1.nabble.com/Compiling-tp3704608.html
Re-hi
now I'm trying to compile Mark R Besonen piece of code allowing to
create folders using the macro language. Unfortunately, I get an
exception error when I try to compile this :
/** START "MakeDirectory_.java" code ** note that "mkdirs" (vs. "mkdir")
makes ** all intermediate parent directories ** even if they don't yet
exist */ import ij.*; import ij.plugin.*; import java.io.*; public class
MakeDirectory_ implements PlugIn { String DirToMake =
Macro.getOptions(); public void run(String arg) { File newDir = new
File(DirToMake); newDir.mkdirs(); } } /** END "MakeDirectory_.java" code */
with "Compile and Run" command.
The error is :
java.lang.NullPointerException
at java.io.File.<init>(File.java:194)
at MakeDirectory_.run(MakeDirectory_.java:13)
at ij.IJ.runUserPlugIn(Unknown Source)
at ij.ImageJ.runUserPlugIn(Unknown Source)
at ij.plugin.PlugInExecuter.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
I think I can't get to use the java.io class but I don't even know how
to add it to ImageJ so it can use it.
Any hint ?
Christophe
--
-- Christophe LETERRIER -------------------
Etudiant en thèse
Equipe Dynamique des Récepteurs Neuronaux
Laboratoire de Neurobiologie
ESPCI-CNRS UMR 7637
10, rue Vauquelin 75231 Paris Cedex 05
Tel 01 40 79 51 84
Fax 01 40 79 47 67
[hidden email]