JnCrMx / discord-game-sdk4j

Java bindings for Discord's Game SDK
MIT License
114 stars 23 forks source link

Doesn't work on Ubuntu 20.04 #54

Open djohts opened 1 year ago

djohts commented 1 year ago

Hello, I am using a minecraft launcher which has a module for Discord rich presence which uses this library, yet it doesn't work on Ubuntu 20.04 due to outdated libc6 version (upgrading to 21 is not an option for me, as most of the guides say to do (nor I want to spend hours of time to update libc manually)).

Error:

java.lang.UnsatisfiedLinkError: /home/alex/.minecraftlauncher/SoF/guard/libdiscord_game_sdk_jni.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/alex/.minecraftlauncher/SoF/guard/libdiscord_game_sdk_jni.so)
$ uname -a
Linux pcdjoh 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
JnCrMx commented 1 year ago

Hello,

I am working towards a Java-only implementation of this library, which then would not have this issue.

Until then, you can attempt to compile the library and by that also the native library from source: https://github.com/JnCrMx/discord-game-sdk4j#building-the-native-library-from-source

letorbi commented 1 year ago

The java-impl branch contains the Java-only implementation. It is currently known to work with Windows, Mac (Intel & ARM) as well as Arch Linux (and probably other distros).

It is mostly API compatible to the master branch and even though some things might be missing, the main features are available.

I am using that branch for a little project of mine, and it is working fine so far. You can use JitPack to include the java-impl branch into your project.