flathub / com.makemkv.MakeMKV

https://flathub.org/apps/details/com.makemkv.MakeMKV
9 stars 20 forks source link

MakeMKV apparently does not work with openjdk11. #25

Closed parasense closed 3 years ago

parasense commented 3 years ago

Please see here: https://www.makemkv.com/forum/viewtopic.php?t=18879

With the bundled version of openjdk11 we see the following error in the debug log:

...
003344:0000 Using Java runtime from /app/jre/bin/java
java_exception(6) : java.lang.NullPointerException
java.lang.NullPointerException
    at com.makemkv.Runtime.a(Unknown Source)
    at com.makemkv.Runtime.b(Unknown Source)
    at com.makemkv.g.action(Unknown Source)
    at blues.Server.actionInvoke(Server.java:245)
    at blues.Server.access$000(Server.java:33)
    at blues.Server$1.run(Server.java:196)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
...

According to the MakeMKV forums the older java 1.8 should be used instead. Perhaps the "sdk org.freedesktop.Sdk.Extension.openjdk8" could be used instead?

That said, I tried to configure an override so MakeMKV points at my system-wide java.

sudo flatpak override --filesystem=/usr/lib/jvm/ com.makemkv.MakeMKV

And, then of course configuring MakeMKV preferences accordingly to use "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.fc32.x86_64/jre/bin/java"

But that doesn't work either, the log goes like this:

004041:0000 Failed to execute external program 'java' from location '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.fc32.x86_64/jre/bin/java'

Does anybody have an idea of a way forward?

parasense commented 3 years ago

In theory this patch would be the starting point

diff --git a/com.makemkv.MakeMKV.json b/com.makemkv.MakeMKV.json
index e5df569..b005b40 100644
--- a/com.makemkv.MakeMKV.json
+++ b/com.makemkv.MakeMKV.json
@@ -5,7 +5,7 @@
   "sdk": "org.kde.Sdk",
   /* NOTE: java is optional to help find blu-ray main titles */
   "sdk-extensions": [
-    "org.freedesktop.Sdk.Extension.openjdk11"
+    "org.freedesktop.Sdk.Extension.openjdk8"
   ],
   "finish-args": [
     "--filesystem=host",
@@ -20,7 +20,7 @@
   ],
   "command": "makemkv",
   "build-options" : {
-    "append-path": "/usr/lib/sdk/openjdk11/bin"
+    "append-path": "/usr/lib/sdk/openjdk8/bin"
   },
   "rename-desktop-file": "makemkv.desktop",
   "rename-icon": "makemkv",
@@ -34,7 +34,7 @@
       "name": "openjdk",
         "buildsystem": "simple",
         "build-commands": [
-          "/usr/lib/sdk/openjdk11/install.sh"
+          "/usr/lib/sdk/openjdk8/install.sh"
         ]
     },
     {

A few remarks:

Thanks for reading this far.

parasense commented 3 years ago

Java does not fail with "java.lang.NullPointerException" using #26 However, I'm not sure how well the feature actually works from MakeMKV perspective. I'm able to load a few titles known to cause java to load, and no more "java.lang.NullPointerException", but not very great title detection, or possibly no smart title detection.

wberrier commented 3 years ago

Seems like an improvement to me, thanks for testing