I have a strange behaviour on Linux
If I execute imageJ from its normal working path, the startupMacros are not loaded (my own compile). If I run the same imageJ from within JBuilder2006, then the startup macros are loaded as expected. The macros also load perfectly normal with the SAME compiled imageJ if I run it on a Windows PC. Given that the problem does not occur from within JBuilder, this is a bit tricky to debug, however, I dug down with a lot of System.out.println commands to narrow the problem down. in Menus.java, version 1.41h line 782 macrosPath is defined correctly: macrosPath = pluginsDir+Prefs.separator+"macros"+Prefs.separator; //but then macrosPath = pluginsDir+Prefs.separator+"macros"+Prefs.separator; } File f = macrosPath!=null?new File(macrosPath):null; if (f!=null && !f.isDirectory()) macrosPath = null; macrosPath is set to null on Linux if and only if run from a console due to f.isDirectory() returning an incorrect value. I ruled out that this is a file permission problem by double-checking permissions and repeating the test as a superuser. I am appending some log messages I got from additional System.out.println statements when running ImageJ as either from a superuser shell (macros failing to load) or from within JBuilder (working as expected and as on a Windows system). System: imageJ version 1.39s (but should also happen in 1.41h from a quick look at the code) SUSE 10.3 x64, jdk1.6.0_04, JBuilder2006, reproducible on SUSE 11 x64 with jdk1.6.0_08 Any ideas or workarounds most welcome! Tux ////////// failed to load from shell //////////////////////// 11:48 tux:../ij/ij-139s-am129 > su Password: 11:48 tux:../ij/ij-139s-am129 # ./ij-dev-run-laptop homeDir==null homeDir (b)=/home/arndt/j/ij/ij-139s-am129 homeDir (c)=/home/arndt/j/ij/ij-139s-am129 userHome (a)=/root prefsDir (b)=/root/.imagej FileInputStream(homeDir+/+PROPS_NAME), arg=/home/arndt/j/ij/ij-139s-am129/IJ_Props.txt loadPreferences(path) path=/root/.imagej/IJ_Prefs.txt homeDir=/home/arndt/j/ij/ij-139s-am129 pluginsPath (b)=null pluginsPath (d)=/home/arndt/j/ij/ij-139s-am129/plugins/plugins/ macrosPath (a)=/home/arndt/j/ij/ij-139s-am129/plugins/macros/ (macrosPath != null) with macrosPath=/home/arndt/j/ij/ij-139s-am129/plugins/macros/ f.getPath()= /home/arndt/j/ij/ij-139s-am129/plugins/macros f.getName()= macros f.exists() is false for /home/arndt/j/ij/ij-139s-am129/plugins/macros f.isDirectory() is false for /home/arndt/j/ij/ij-139s-am129/plugins/macros f.isFile() is false for /home/arndt/j/ij/ij-139s-am129/plugins/macros f.Absolute is true for /home/arndt/j/ij/ij-139s-am129/plugins/macros f.canWrite() is false for /home/arndt/j/ij/ij-139s-am129/plugins/macros f.pathSeparator= : f.separator= / macrosPath (b)=/home/arndt/j/ij/ij-139s-am129/plugins/macros/ ///////////// same log when run from JBuilder - good behaviour /////// /usr/java/jdk1.6.0_04/bin/java -classpath "/home/arndt/j/ij/ij-139s-am129/plugins:/usr/java/jdk1 [..] /jnlp-servlet.jar" -mx764m ij.ImageJ homeDir==null homeDir (b)=/home/arndt/j/ij/ij-139s-am129 homeDir (c)=/home/arndt/j/ij/ij-139s-am129 userHome (a)=/home/arndt prefsDir (b)=/home/arndt/.imagej FileInputStream(homeDir+/+PROPS_NAME), arg=/home/arndt/j/ij/ij-139s-am129/IJ_Props.txt loadPreferences(path) path=/home/arndt/.imagej/IJ_Prefs.txt homeDir=/home/arndt/j/ij/ij-139s-am129 pluginsPath (b)=null pluginsPath (d)=/home/arndt/j/ij/ij-139s-am129/plugins/ macrosPath (a)=/home/arndt/j/ij/ij-139s-am129/macros/ (macrosPath != null) with macrosPath=/home/arndt/j/ij/ij-139s-am129/macros/ f.getPath()= /home/arndt/j/ij/ij-139s-am129/macros f.getName()= macros f.exists() is true for /home/arndt/j/ij/ij-139s-am129/macros f.isDirectory() is true for /home/arndt/j/ij/ij-139s-am129/macros f.isFile() is false for /home/arndt/j/ij/ij-139s-am129/macros f.Absolute is true for /home/arndt/j/ij/ij-139s-am129/macros f.canWrite() is true for /home/arndt/j/ij/ij-139s-am129/macros f.pathSeparator= : f.separator= / macrosPath (b)=/home/arndt/j/ij/ij-139s-am129/macros/ |
Hi Tux,
On Tue, 22 Jul 2008, Tux Hacker wrote: > ////////// failed to load from shell //////////////////////// > 11:48 tux:../ij/ij-139s-am129 > su > Password: What the... ? Running ImageJ as _root_? > pluginsPath (b)=null > pluginsPath (d)=/home/arndt/j/ij/ij-139s-am129/plugins/plugins/ This tells me that your script to run ImageJ from the command line sets plugins.dir to .../plugins/! Compare that to theoutput from JBuilder: > ///////////// same log when run from JBuilder - good behaviour /////// > > [...] > userHome (a)=/home/arndt Saner. > pluginsPath (b)=null > pluginsPath (d)=/home/arndt/j/ij/ij-139s-am129/plugins/ It obviously sets plugins.dir _not_ to .../plugins/. Hth, Dscho |
Free forum by Nabble | Edit this page |