NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 858 - setting "FIJI_PREFS_DIR" without effect
setting "FIJI_PREFS_DIR" without effect
Status: ASSIGNED
Product: Fiji
Classification: Unclassified
Component: ImageJ1
unspecified
PC Windows
: P5 enhancement
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-07-17 05:52 CDT by Christian
Modified: 2014-07-17 11:02 CDT
2 users (show)

See Also:

Description Christian 2014-07-17 05:52:46 CDT
Despite having set  "FIJI_PREFS_DIR" to an exsisting and writeable path (C:\Fiji_Pref), Fiji uses an invalid path obtained by system.get.property(user.home) See bug 187. Trying to save preferences results in an error message: "error saving preferences \\fileserver\profiles$\Desktop\.imagej\IJ_Prefs.txt (Zugriff verweigert)"
I checked whether a beanshell skript can retreive the set value of  "FIJI_PREFS_DIR" and what FIJI uses as PrefsDir instead. See content of beanshell window below:

Starting BeanShell...
All ImageJ and java.lang and TrakEM2 classes imported.
Ready -- have fun.
>>>
>>> e = System.getenv("IJ_PREFS_DIR")
C:\Fiji_Pref

>>> print(ij.Prefs.getPrefsDir())
\\fileserver\profiles$\Desktop\.imagej

>>> ij.Prefs.savePreferences()

The last skript command leads to said error message.
Comment 1 Johannes Schindelin 2014-07-17 08:40:15 CDT
I believe it should work using IJ_PREFS_DIR instead of FIJI_PREFS_DIR. Could you try that?
Comment 2 Curtis Rueden 2014-07-17 10:04:16 CDT
The bug is caused by a javassist problem:

IJ_PREFS_DIR=/Users/curtis/fiji /Applications/Science/Fiji.app/Contents/MacOS/ImageJ-macosx
Jul 17 10:03:33 sirius ImageJ-macosx[13910] <Error>: The function `CGContextErase' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
java.lang.IllegalArgumentException: Cannot override field access to prefsDir in ij.Prefs's public java.lang.String load(java.lang.Object ij, java.applet.Applet applet)
	at net.imagej.patcher.CodeHacker.overrideFieldWrite(CodeHacker.java:630)
	at net.imagej.patcher.LegacyExtensions.injectHooks(LegacyExtensions.java:220)
	at net.imagej.patcher.LegacyInjector.inject(LegacyInjector.java:286)
	at net.imagej.patcher.LegacyInjector.injectHooks(LegacyInjector.java:87)
	at net.imagej.patcher.LegacyEnvironment.initialize(LegacyEnvironment.java:101)
	at net.imagej.patcher.LegacyEnvironment.applyPatches(LegacyEnvironment.java:496)
	at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:365)
	at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:344)
	at fiji.IJ1Patcher.run(IJ1Patcher.java:37)
	at net.imagej.launcher.ClassLauncher.patchIJ1(ClassLauncher.java:195)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:154)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
Caused by: javassist.CannotCompileException: No code replaced!
	at net.imagej.patcher.CodeHacker$EagerExprEditor.instrument(CodeHacker.java:1280)
	at net.imagej.patcher.CodeHacker.overrideFieldWrite(CodeHacker.java:616)
	... 11 more
[WARNING] 2 exceptions occurred during plugin discovery.
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Applications/Science/Fiji.app/jars/slf4j-log4j12-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Applications/Science/Fiji.app/jars/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[ERROR] Skipping unsupported option -port7

I'm investigating it now.
Comment 3 Christian 2014-07-17 11:02:41 CDT
Hi Johannes,
gosh, I did make a mess of it, didn't I. But actually, the variable I used was IJ_PREFS_DIR, I just got it wrong in the wording of the bugzilla report.