nvdweem / PCPanel

Third party/community managed controller software for the PCPanel (getpcpanel.com) devices.
Other
87 stars 6 forks source link

Unable to run built program on Linux openSUSE Tumbleweed #63

Open Tiildus opened 1 month ago

Tiildus commented 1 month ago

I am running linux open SUSE Tumbleweed and have tried to install and run version 1.6 of this program using the jar which did not work. I then was able to build the program using maven. But when I run the program I get an error message similar to when I run the Jar. Not sure if I am missing some dependency or something. I have also done the preparation steps from linux.md. Below is the error message that is outputted after I try to run the program.

19:41:54.931 [main] ERROR com.getpcpanel.util.FileChecker - Unable to create lock file /root/.pcpanel/lock.txt, allowing duplicate instances.
java.io.IOException: No such file or directory
        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.base/java.io.File.createNewFile(Unknown Source)
        at com.getpcpanel.util.FileChecker.tryCreateLockFile(FileChecker.java:74)
        at com.getpcpanel.util.FileChecker.createAndStart(FileChecker.java:33)
        at com.getpcpanel.Main.main(Main.java:20)
19:41:54.937 [main] WARN com.getpcpanel.util.FileChecker - Unable to determine if the application is already running, pretending it isn't.
java.io.FileNotFoundException: /root/.pcpanel/lock.txt (No such file or directory)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(Unknown Source)
        at java.base/java.io.RandomAccessFile.<init>(Unknown Source)
        at java.base/java.io.RandomAccessFile.<init>(Unknown Source)
        at com.getpcpanel.util.FileChecker.isDuplicate(FileChecker.java:57)
        at com.getpcpanel.util.FileChecker.createAndStart(FileChecker.java:36)
        at com.getpcpanel.Main.main(Main.java:20)
19:41:54.938 [File Checker Thread] INFO com.getpcpanel.util.FileChecker - File checker started
19:41:54.941 [File Checker Thread] ERROR com.getpcpanel.util.FileChecker - Unable to register for event in file checker
java.nio.file.NoSuchFileException: /root/.pcpanel
        at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.UnixException.asIOException(Unknown Source)
        at java.base/sun.nio.fs.LinuxWatchService$Poller.implRegister(Unknown Source)
        at java.base/sun.nio.fs.AbstractPoller.processRequests(Unknown Source)
        at java.base/sun.nio.fs.LinuxWatchService$Poller.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Exception in thread "main" java.lang.UnsupportedOperationException: Unable to open DISPLAY
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.<init>(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.Application.run(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
nvdweem commented 1 month ago

The first few exceptions are about the lock file, I don't think those are a big issue.

The big problem seems to be

Exception in thread "main" java.lang.UnsupportedOperationException: Unable to open DISPLAY
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(Unknown Source)

Not being able to open the display probably means that you are using a desktop environment that isn't supported by JavaFX or you are running in headless mode (only terminal). If you are running headless then there isn't much to be done currently, but I'm expecting you are not (I'd expect someone who only uses the terminal to be aware that that could cause issues).

This stackoverflow seems to give some possible solutions: https://stackoverflow.com/questions/5241850/running-java-gui-applications-through-a-linux-terminal/24247175 It's a very old ticket, so if you blindly follow some of the instructions you might end up with a very old Java version.