-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JabRef ignores Djava.util.prefs.userRoot #8509
Comments
I was trying to verify if this may be an upstream bug, but it seems that users may be able to partially override the configuration location, so it's possible that this is an actual bug. |
I am having no LInux here atm and first time I hear about this. |
Hi @Siedlerchr , thanks again for your response! I tried the following options:
In all cases a new However, I'm not sure if there are other tests going on that may nudge JabRef (or Java) to create the file in I was progressing alphabetically in moving or categorizing some folders to their respective Could these directories be nudging JabRef to think that it must write in |
NO idea, though, JabRef does use the normal Java preferences mechanism, so the thing should work. Have you tried with the absolute path in the switch and starting from terminal ./jabref afterwards? I only found this guide which mentions this in the last section as well |
Interesting... I went ahead and did some poking around, and I had many things to report back, so... sorry for a huge write-up. Java optionsSo, I wanted to learn a bit more about the options passed on to user@computer:~$ java --help
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/rolandog/.config/java
... And this was also the case for the bundled user@computer:~$ /opt/jabref/lib/runtime/bin/java --help
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/rolandog/.config/java
... Shell scriptInspecting the shell script: user@computer:/$ cat /opt/jabref/lib/runtime/bin/JabRef
#!/bin/sh
SCRIPT_NAME=$(basename "$0")
APP_NAME=${SCRIPT_NAME%.sh}
DIR="${0%/*}"
"$DIR/java" $CDS_JVM_OPTS -p "$DIR/../app" -m org.jabref/org.jabref.gui.JabRefLauncher "$@" I don't know if the module path user@computer:/$ tree /opt/jabref/
/opt/jabref/
├── bin
│ └── JabRef
└── lib
├── app
│ └── JabRef.cfg
└── runtime
└── bin
├── JabRef
├── JabRef.bat
└── java Wouldn't Manually launchingInspecting the shell script's command: "$DIR/java" \
$CDS_JVM_OPTS \
-p "$DIR/../app" \
-m org.jabref/org.jabref.gui.JabRefLauncher \
"$@" If I'm interpreting the shell script correctly, it would expand to the following values (if I set the /opt/jabref/lib/runtime/bin/java \
-Djava.util.prefs.userRoot=/home/rolandog/.config/java \
-p /opt/jabref/lib/runtime/bin/../app \
-m org.jabref/org.jabref.gui.JabRefLauncher Here's the output of running the previous command: rolandog@computer:~$ /opt/jabref/lib/runtime/bin/java \
-Djava.util.prefs.userRoot=/home/rolandog/.config/java \
-p /opt/jabref/lib/runtime/bin/../app \
-m org.jabref/org.jabref.gui.JabRefLauncher
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/rolandog/.config/java
Feb 20, 2022 12:15:28 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
2022-02-20 12:15:28 [JavaFX Application Thread] org.jabref.logic.net.URLDownload.bypassSSLVerification()
WARN: Fix SSL exceptions by accepting ALL certificates
Feb 20, 2022 12:15:28 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
2022-02-20 12:15:28 [JavaFX Application Thread] org.jabref.migrations.PreferencesMigrations.upgradeStoredBibEntryTypes()
INFO: Migrating old custom entry types.
2022-02-20 12:15:29 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2022-02-20 12:15:29 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
Feb 20, 2022 12:15:30 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
WARNING: Resource "" not found. And changing However... there are some good news to report here! The good news is that no LauncherNot all is good news, however. Opening JabRef with the regular launcher also has its issues... it creates I decided to check the syslog, and here's the output: user@computer:~$ tail -f /var/log/syslog | grep -i jabref
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: Feb 20, 2022 12:45:14 PM com.sun.javafx.application.PlatformImpl startup
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: WARNING: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: 2022-02-20 12:45:14 [JavaFX Application Thread] org.jabref.logic.net.URLDownload.bypassSSLVerification()
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: WARN: Fix SSL exceptions by accepting ALL certificates
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: Feb 20, 2022 12:45:14 PM java.util.prefs.FileSystemPreferences$1 run
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: INFO: Created user preferences directory.
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: 2022-02-20 12:45:14 [JavaFX Application Thread] org.jabref.migrations.PreferencesMigrations.upgradeStoredBibEntryTypes()
Feb 20 12:45:14 computer jabref-JabRef.desktop[32960]: INFO: Migrating old custom entry types.
Feb 20 12:45:15 computer jabref-JabRef.desktop[32960]: 2022-02-20 12:45:15 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
Feb 20 12:45:15 computer jabref-JabRef.desktop[32960]: INFO: Not updating theme because it hasn't changed
Feb 20 12:45:15 computer jabref-JabRef.desktop[32960]: 2022-02-20 12:45:15 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
Feb 20 12:45:15 computer jabref-JabRef.desktop[32960]: INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
Feb 20 12:45:16 computer jabref-JabRef.desktop[32960]: Feb 20, 2022 12:45:16 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
Feb 20 12:45:16 computer jabref-JabRef.desktop[32960]: WARNING: Resource "" not found.
Feb 20 12:45:17 computer JabRef[32960]: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.
Feb 20 12:45:18 computer jabref-JabRef.desktop[32960]: Feb 20, 2022 12:45:18 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
Feb 20 12:45:18 computer jabref-JabRef.desktop[32960]: WARNING: Resource "" not found.
Feb 20 12:45:49 computer systemd[2505]: app-gnome-jabref\x2dJabRef-32960.scope: Deactivated successfully.
Feb 20 12:45:49 computer systemd[2505]: app-gnome-jabref\x2dJabRef-32960.scope: Consumed 12.800s CPU time.
I have two theories to test to make the launcher properly work: ExecInspecting the launcher(s) (I imagine the installer copies the .desktop file from user@computer:~$ cat /usr/share/applications/jabref-JabRef.desktop
[Desktop Entry]
Name=JabRef
GenericName=BibTeX Editor
Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.
Exec=/opt/jabref/bin/JabRef
Icon=/opt/jabref/lib/JabRef.png
Terminal=false
Type=Application
MimeType=text/x-bibtex
Categories=Office;
Keywords=bibtex;biblatex;latex;bibliography
StartupWMClass=jabref I notice it's using Non-interactive non-login shell environment variablesI will test later by setting the environment variable Edit: formatting |
Reporting back... Modifying the Exec path launched JabRef, but it still created Setting the environment variables with PAM worked properly (even got a |
Ok, after testing with a different app, I can conclude that this isn't a JabRef-specific bug, since other java-based apps also create a I'll see if I can report it upstream, though the fix would probably have to take into account Hyrum's law, and check if there's a Thank you very much for the pointer to the Oracle docs! |
Thanks for the writeup! Thanks for the confirmation that the .java is created by JDK by default. You can report bugs in java here: https://bugreport.java.com/bugreport/ |
Thanks for the pointer, I didn't know where to start looking that up, as I'm not that familiar with Java. |
So, one of the requirements in order to submit a bug was to test with the latest early access version of Java. I created a backup copy of user@computer:~$ /opt/jabref/lib/runtime/bin/java -Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java -p /opt/jabref/lib/runtime/bin/../app -m org.jabref/org.jabref.gui.JabRefLauncher
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/rolandog/.config/java
Error occurred during initialization of boot layer
java.lang.module.FindException: Module org.jabref not found
After googling a bit, it seems like this may have to do with how the classes are defined? In any case, I'm not very knowledgeable yet in how to build java programs from source, and this seems to be a known, though not very documented, behavior (found while trying to find if this was already reported upstream, which it doesn't seem to be the case). So I guess I'll leave it alone for now. |
JabRef version
5.5 (latest release)
Operating system
GNU / Linux
Details on version and operating system
Ubuntu 21.10 x86_64 with GNOME 40.5
Checked with the latest development build
Steps to reproduce the behaviour
export_JAVA_OPTIONS
variable to use XDG Base Directory specification:export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
~/.java
to$XDG_CONFIG_HOME/java
~/.java
gets created again)Appendix
On a positive note
$XDG_DATA_HOME
is properly followed, as can be seen from the logs when creating the index.The text was updated successfully, but these errors were encountered: