Phoenix09 / filebot

This is a fork of FileBot with an up-to-date JAR and MSI installer with the donate nag removed.
https://www.filebot.net/
GNU General Public License v3.0
99 stars 19 forks source link

JNI Error when running 4.7.19 #1

Closed Lumilias closed 6 years ago

Lumilias commented 6 years ago

Hey Phoenix09,

First of all, thanks for repackaging Filebot. I would have compiled it from source too (since rednoah basically screwed those using Windows Server) but I decided against it since finding your release.

Anyways, I get the following error when launching 4.7.19: Error: A JNI error has occurred, please check your installation and try again.

Have you checked that this version runs in your own testing? Also, I noticed in the merged commits that rednoah added support for Java 9. Does it maybe need to be repackaged under JDK 9?

Thanks again for doing this!

Phoenix09 commented 6 years ago

the problem is FileBot was changed to compile with Java 9.

java -jar FileBot_4.7.19.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

it works for me as I'm running Java 9. I'll revert it to Java 8 soon.

Lumilias commented 6 years ago

Thanks! I tried running the GUI with JRE 9 installed, but it popped up with a message saying it required a JRE 1.8.0 environment to run in. I've got no problem with moving to JRE 9 personally.

Phoenix09 commented 6 years ago

As Java 8 is still the recommended version I think switching back to 8 is the better option.

Also only the GUI runs with 9: https://github.com/Phoenix09/filebot/commit/a2662791d07fbe69b4e8f24b968f90c850e9ae60

Lumilias commented 6 years ago

Ah, now that you mention that, I installed both JRE 8 & JRE 9 to test this. Using the launcher.exe shortcut fails with that error, but launching it directly via java -jar does allow the GUI to run.

So if you switch it back to Java 8, would that GUI commit be reverted back to 8 as well?

vvs commented 6 years ago

It is not enough to install Java 9 / JRE 9, at least it wasn't enough for me, I had to modify the registry, somewhere here: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment. I've added the 9.0.1 key similar to what existed to 1.8, with JavaHome and RuntimeLib.

After that, the Filebot launcher was able to understand that JRE9 is installed and everything started working fine.

Lumilias commented 6 years ago

@vvs Thanks for the tip! I did the same and it works again.

belidzs commented 6 years ago

Attached relevant registry file which adds required keys to registry. It needs java 9.0.4 installed under C:\Program Files\Java\jre-9.0.4 but the file can be edited manually to work with other versions installed under different locations.

Original Java installer creates these keys under HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE instead of HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment which confuses filebot.launcher.exe

java9.zip

Phoenix09 commented 6 years ago

this should be fixed with the latest release