Posted by
dscho on
Jul 24, 2008; 12:33pm
URL: http://imagej.273.s1.nabble.com/Fixed-StartupMacros-not-loading-on-Linux-system-tp3695531p3695532.html
Hi,
On Thu, 24 Jul 2008, Koala wrote:
> Thanks for noting the /plugins/plugins bit Johannes - that got me on the
> right track. It is actually a bug in Menus.java and below is the bugfix.
> Interesting though it does not go wrong from within JBuilder on Linux...
Who is "AM"?
Besides, I have the impression that you _break_ existing setups with your
"fix".
Sure, plugins.dir is a misnomer, but that makes it no better if you break
_my_ running system.
> // bugfix added 20080724 by AM: on Linux systems 'property' is
> not null
> // and returns a path for pluginsDir that already ends in
> '/plugins' which
> // leads to pluginsPath ending in ../plugins/plugins/ and
> macrosPath in
> // ../plugins/macros
> // the variable name of pluginsDir is not well chosen as it
> really is the
> // directory to where the ij executable is running from - hence
> ijHomeDir
> // would be a better name for pluginsDir.
> if((pluginsDir.endsWith(Prefs.separator))){
> pluginsDir = pluginsDir.substring(0,pluginsDir.length() - 1);
> if (IJ.debugMode)
> System.out.println("pluginsDir ends with directory
> separator");
> }
Why? It is _perfectly_ legal for pluginsDir to end in a slash.
> if((pluginsDir.endsWith(Prefs.separator+"plugins"))){
> pluginsDir = pluginsDir.substring(0,pluginsDir.length() - 8);
> if (IJ.debugMode)
> System.out.println("pluginsDir already ended in '/plugins' -
> chopped off");
> }// end of bugfix
And this is where things can break.
I'd rather have you fix _your_ invocation, especially since JBuilder
already had it right, than to change ImageJ for that.
Ciao,
Dscho