ClementGre / PDF4Teachers

PDF editing software in large quantities. Designed for teachers, this app keeps recorded previous annotations, and offers features like marking scale, PDF conversion, vectorial drawing...
https://pdf4teachers.org/
Apache License 2.0
136 stars 17 forks source link

on update, program crashes if the ~/.PDF4Teachers folder is already present #159

Closed flauta closed 1 year ago

flauta commented 1 year ago

Prerequisite

Describe the bug

After updating directly in the /opt folder from tar.gz, the program crashes if the personal ~/.PDF4Teachers folder is already present. Deleting the folder, program starts correctly and re-creates the folder (loosing all previous settings)

To Reproduce

Check the console

/opt/pdf4teachers/bin/PDF4Teachers 
08:29:34.020 INFO    Main main() Starting PDF4Teachers 1.4.0 | Java 17.0.1 on JFX 17+18 on Linux 6.1.12-1-MANJARO (amd64)
08:29:34.039 INFO    Main main() Run mode: release | Log level: info
08:29:34.499 ERROR   Main start() Unable to create dir /home/litosfera/.PDF4Teachers
java.lang.RuntimeException: Unable to create dir /home/litosfera/.PDF4Teachers
    at fr.clementgre.pdf4teachers@1.4.0/fr.clementgre.pdf4teachers.utils.FilesUtils.moveDir(Unknown Source)
    at fr.clementgre.pdf4teachers@1.4.0/fr.clementgre.pdf4teachers.utils.FilesUtils.moveDataFolder(Unknown Source)
    at fr.clementgre.pdf4teachers@1.4.0/fr.clementgre.pdf4teachers.utils.PlatformUtils.getDataFolder(Unknown Source)
    at fr.clementgre.pdf4teachers@1.4.0/fr.clementgre.pdf4teachers.Main.setup(Unknown Source)
    at fr.clementgre.pdf4teachers@1.4.0/fr.clementgre.pdf4teachers.Main.start(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

Edits

No response

Screenshots

No response

Desktop

Linux Manjaro amd64

ClementGre commented 1 year ago

PDF4Teachers is now storing it's data in $XDG_DATA_HOME/PDF4Teachers or ~/.local/share/PDF4Teachers to fit XDG convention (#127). PDF4Teachers is then copying data folder from ~/.PDF4Teachers, but this is bugged in 1.4.0, and leads to an error.

The bug is now fixed for futures releases. What you can do is to copy the folder yourself, or just delete it. Thank you for reporting this bug.