JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.59k stars 2.54k forks source link

Bibtex can not save file when Tex Studio is open on Windows 11 #11916

Open austindowney opened 3 days ago

austindowney commented 3 days ago

JabRef version

5.15 (latest release)

Operating system

Windows

Details on version and operating system

JabRef 5.15--2024-07-10--1eb3493; Windows 11 10.0 amd64; Java 21.0.2; JavaFX 22.0.1+7

Checked with the latest development build (copy version output from About dialog)

Steps to reproduce the behaviour

If Texstudio is open, Jabref can not save the file.

Sometimes if I compile the document and try to save the .bib file during the compile it will save.

The issue is the same as reported here https://tex.stackexchange.com/questions/727245/jabref-cannot-save-file-while-texstudio-is-running

The issue has to do with Windows holding access to the file. See the errors below.

org.jabref.logic.exporter.SaveException: Problems saving: java.nio.file.FileSystemException: C:\Users\adowney2\Downloads\Curriculum_vitae\publications.bib.tmp -> C:\Users\user2\Downloads\Curriculum_vitae\publications.bib: The process cannot access the file because it is being used by another process at org.jabref@5.15.60000/org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(Unknown Source) at org.jabref@5.15.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref@5.15.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref@5.15.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)

Appendix

...

Log File ``` Paste an excerpt of your log file here ```
ThiloteE commented 2 days ago

My first thought would be to check, if Tex Studio is triggering Windows to lock the file (which would be an external issue and better be reported to Tex Studio), but according to the tex.stackexchange post, it is apparently possible to edit the file with Visual Studio Code, so it could be an JabRef issue. Best to test what Visual Studio Code does exactly. "Editing" does not mean "saving". According to your report, JabRef also can "edit" those files, but cannot "save".

austindowney commented 1 day ago

My first thought would be to check, if Tex Studio is triggering Windows to lock the file (which would be an external issue and better be reported to Tex Studio), but according to the tex.stackexchange post, it is apparently possible to edit the file with Visual Studio Code, so it could be an JabRef issue. Best to test what Visual Studio Code does exactly. "Editing" does not mean "saving". According to your report, JabRef also can "edit" those files, but cannot "save".

If I run the .tex file in Texstudio, I can not save changes to the .bib made in jabref until I close out of the .tex studio. I can open the .bib file in notepad ++ make edits, and save it, all while jabref cannot save it.

All of that is to say that Texstudio could be locking the file, but Notepad ++ can save it. So I don't know if this is an issue to report to Texstudio or Jabref.