Adamcake / Bolt

An alternative launcher for your favourite MMO
GNU Affero General Public License v3.0
162 stars 23 forks source link

Runelite not opening on first install [AUR] #34

Closed aellas closed 3 months ago

aellas commented 5 months ago

Hiya, I'm using Arch + Hyprland to play OSRS

I've noticed if you install bolt-launcher via the aur (not sure about flatpak version) on a fresh install of arch / never installed bolt-launcher or runelite and you run runelite via bolt for the first time it never starts the runelite client, even though it says it's downloaded runelite and the GUI says "Game launch status: 'OK'' however that isn't the case. To rectify this I've found I needed to install runelite via the aur and then I can run runelite via bolt. I've also tested removing runelite 'pacman -R runelite' and bolt will still launch runelite like you would expect (I assume through the downloaded version bolt does) but I'm not totally sure.

Adamcake commented 5 months ago

I haven't heard of that before. You said you installed the RuneLite package directly from AUR to fix the issue - is it possible that this also installed a dependency needed for RuneLite to run, like Java?

aellas commented 5 months ago

I haven't heard of that before. You said you installed the RuneLite package directly from AUR to fix the issue - is it possible that this also installed a dependency needed for RuneLite to run, like Java?

That would be correct. Believe it prompted me to install openjdk.

Adamcake commented 5 months ago

Well there you go then. It is documented in optdepends as 'jre17-openjdk: runelite/hdos' (although incidentally you can use any Java version.) I think it would print something to stderr too.

aellas commented 5 months ago

I don't believe it did print anything, apart from java being good to go or something, this is what I found strange as everything (in the GUI) pointed to having a successful launch, however that wasn't the case.

Adamcake commented 5 months ago

Yeah unfortunately while fork/exec is very flexible and performant it doesn't leave any room for checking the health of your child process. The success message just means that fork() ran successfully. And even if I added some kind of PID monitoring architecture, it would still not know if the issue was a failure to start or if the game crashed later on or was killed by a signal, etc.

dotaxis commented 5 months ago

I think what happened here is that jre17-openjdk is listed as an optional dependency, because RS3 does not require it, but it is required to run RuneLite.

Not sure if it's better to make that dependency mandatory, or if you could have Bolt check if Java is installed when attempting to launch an RS2 client. The former is easier, but either of them would solve the issue.

Adamcake commented 5 months ago

There would be no reason to make it mandatory when not everyone needs it, and of those who do, some might like to use a different version than 17. Although jre17 does come with the flatpak package because flatpak doesn't have any concept of optdepends as far as I know.

I think the way forward will be, check if JAVA_HOME is set and if so check for $JAVA_HOME/bin/java, if that check fails, parse $PATH and try to find an executable called java in each one. This will mean not invoking /usr/bin/env anymore.

Adamcake commented 3 months ago

Lots of changes addressing this in 0.9, it should correctly report Java installation issues now

Groctel commented 3 months ago

I also found this error with the AUR installation, even though my installation is definitely not new. Installing jre17-openjdk didn't solve it, which makes sense because jdk-openjdk (22 at the time of writing) was already installed. It turns out that java-8-openjdk/jre was set as the default Java by archlinux-java by a reason unkown. Switching it to java-22-openjdk solved the issue.

Running bolt from the terminal logs this error when RuneLite is launched with an old JRE:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/runelite/launcher/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)

No action required from this comment. I'm just adding info in case it helps someone :)