Failed to initialize JavaFX

Support for Ubuntu and other Desktop Linux distributions
Post Reply
ShakaZ2005
Posts: 1
Joined: 31 Jan 2018, 18:08

Failed to initialize JavaFX

Post by ShakaZ2005 »

Hello,

I'm using Filebot 4.7.9 on Linux Mint.
It has been working fine for a few weeks till today, where on launch the following error popped up : "Failed to initialize JavaFX. Please install JavaFX." Subsequently Filebot fails to rename any file, while generating another JavaFX error.

This post suggest the following solution if you are using OpenJDK :

Code: Select all

sudo apt-get install openjfx
This didn't work for me at first, though i can confirm it works if openjdk is indeed selected as default. You can check this with :

Code: Select all

sudo update-alternatives --config java
in my case the output is
There are 4 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 manual mode
* 4 /usr/lib/jvm/java-ibm-x86_64-80/jre/bin/java 80 manual mode
Result of further testing reveals :
java-ibm-x86_64-80 --> doesn't work even with openjfx installed
java-8-openjdk-amd64 --> works with openjfx
java-8-oracle --> works even without openjfx

Enjoy
Ligi68
Posts: 1
Joined: 15 Apr 2018, 16:52

Re: Failed to initialize JavaFX

Post by Ligi68 »

Hello,

I have Raspbian Stretch installed on my Rpi 3B+.
I tried to used Filebot but I have the same issue as you "Failed to initialize JavaFX. Please install JavaFX."

I don't understand what you do to make filebot working ? Could you give me some details ?
MasterCATZ
Posts: 38
Joined: 28 May 2012, 23:01

Re: Failed to initialize JavaFX

Post by MasterCATZ »

just gone to Ubuntu 18.04 and have the same issue

also why is the filebot in the Ubuntu store older 4.7.9 than the 4.8.1 patreon site ?

I already paid @ the Ubuntu store before I'm not going to pay to download from another site as well ..

everywhere I am reading javafx is removed from java11 , I can get filebot working with java8 fine


aio@aio:/ZFSRaidz$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 manual mode
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

Press <enter> to keep the current choice[*], or type selection number: 0
aio@aio:/ZFSRaidz$ sudo apt-get install openjfx
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjfx is already the newest version (8u161-b12-1ubuntu2).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
aio@aio:/ZFSRaidz$
ketterer
Posts: 5
Joined: 07 May 2018, 00:38

Re: Failed to initialize JavaFX

Post by ketterer »

Hello,
I am also on ubuntu 18.04 and I have been trying all day to get this to work. I have 4.7.9 deb and it installs fine, then I installed openjfx.

next I ran

Code: Select all

sudo update-alternatives --config java
And output is this

Code: Select all

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
I changed to option 2 and now the orignal message of "Failed to Initialize JavaFX. Please install JavaFX" does not appear, BUT it still doesnt work and the errors I can see are

Code: Select all

ketterer@Ubuntubook-MkV:~$ filebot
Gtk-Message: 20:19:36.354: Failed to load module "canberra-gtk-module"
Fetch failed: https://app.filebot.net/update.xml
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at net.filebot.web.WebRequest.fetch(WebRequest.java:143)
	at net.filebot.CachedResource.lambda$fetchIfModified$9(CachedResource.java:215)
	at net.filebot.CachedResource.lambda$null$0(CachedResource.java:87)
	at net.filebot.CachedResource.retry(CachedResource.java:121)
	at net.filebot.CachedResource.lambda$get$1(CachedResource.java:87)
	at net.filebot.Cache.computeIf(Cache.java:90)
	at net.filebot.CachedResource.get(CachedResource.java:82)
	at net.filebot.Main.checkUpdate(Main.java:243)
	at net.filebot.Main.onStart(Main.java:168)
	at net.filebot.Main.lambda$null$0(Main.java:129)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(SwingUI.java:426)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(SwingUI.java:416)
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at net.filebot.web.WebRequest.fetch(WebRequest.java:140)
	... 11 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	... 12 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	... 12 more

Failed to check for updates
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at net.filebot.web.WebRequest.fetch(WebRequest.java:143)
	at net.filebot.CachedResource.lambda$fetchIfModified$9(CachedResource.java:215)
	at net.filebot.CachedResource.lambda$null$0(CachedResource.java:87)
	at net.filebot.CachedResource.retry(CachedResource.java:121)
	at net.filebot.CachedResource.lambda$get$1(CachedResource.java:87)
	at net.filebot.Cache.computeIf(Cache.java:90)
	at net.filebot.CachedResource.get(CachedResource.java:82)
	at net.filebot.Main.checkUpdate(Main.java:243)
	at net.filebot.Main.onStart(Main.java:168)
	at net.filebot.Main.lambda$null$0(Main.java:129)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(SwingUI.java:426)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(SwingUI.java:416)
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at net.filebot.web.WebRequest.fetch(WebRequest.java:140)
	... 11 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	... 12 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	... 12 more
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Failed to initialize JavaFX

Post by devster »

The 4.7.9 version of FileBot is a Java 8 one, if I remember correctly, and therefore works with Java 8. It does require OpenJFX to be installed and the Ubuntu package only installs it for Java 8.

More recent versions of FileBot do require Java 9 or above (not sure since when), but there are still backports to 1.8.

OpenJDK 11 (which on Ubuntu Bionic is just 10.0.1+10) does not have OpenJFX anymore and it requires a recompilation to add the modules.
These modules should only be required for the GUI however, and for building FileBot from source so a workaround is to just use FileBot from the command line.
I only work in black and sometimes very, very dark grey. (Batman)
ketterer
Posts: 5
Joined: 07 May 2018, 00:38

Re: Failed to initialize JavaFX

Post by ketterer »

do you know any workaround to get the gui to work with ubuntu 18.04?
i thought changing the default java version would work but doesnt seem to.
any ideas anyone?
ben2talk
Posts: 6
Joined: 12 Mar 2018, 17:00

Re: Failed to initialize JavaFX

Post by ben2talk »

This has been working for me on and off... about the fifth time I opened Filebot I started getting the failure to initialize JavaFX.

Also a message...
WARNING: Prefs file removed in background /home/ben/.java/.userPrefs/prefs.xml

Any ideas?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

1.
Are you sure that you have installed JavaFX? Like the OpenJFX package, or Oracle JDK 8 or 10. Make sure you're not using Oracle JDK 11 since does no longer include JavaFX libraries (and FileBot may not be fully compatible yet).


2.
The Prefs warning can be ignored. It's just a warning from the Java Prefs module and not specific to FileBot.
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Failed to initialize JavaFX

Post by cheaters »

I am receiving the same error. Can anyone help with downgrading to Java10 on a Mac. I am stumped. Java upgraded itself to Java11 and I see no way to downgrade via Brew…
Java SE 10 Downloads
Java SE 10 has reached end of support. Users of Java SE 10 should switch to Java SE 11.
Please visit our Java SE Downloads page to get the current version of Java SE.
I found the JDK here
http://jdk.java.net/10/

I have never created or maintained a Tap in Brew and I don't see Java10 in Caskroom/Versions.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

The brew cask package is currently broken. Please use the macOS installer (*.pkg) instead for the time being.

:arrow: https://github.com/filebot/plugins/blob ... ler/pkg.sh
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Failed to initialize JavaFX

Post by cheaters »

Thanks Red!

Before I used that package I uninstalled Java on my machine and all existing versions of FileBot (Mac App Store and Brew version). I installed FileBot from the package you linked to. It's telling me there is no Java on my machine. I'm confused. I thought it was linking to the version of Java in it's own package. I am lost. Help please.

Code: Select all

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (8):
    11.0.1, x86_64:	"Java SE 11.0.1"	/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
    11.0.1, x86_64:	"OpenJDK 11.0.1"	/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
    11, x86_64:	"Java SE 11"	/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    11, x86_64:	"OpenJDK 11"	/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home
    10.0.2, x86_64:	"Java SE 10.0.2"	/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
    1.8.0_192, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
    1.8.0_181, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
    1.8.0_172, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

Code: Select all

$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

The PKG package does not use or require Java installed on your system. If it says that you need java, then you're likely samehow inadvertently using the brew cask package. Call brew cask zap filebot to make sure to uninstall that first.

What does the console say if you run the pkg.sh install script?

Code: Select all

sh -xu <<< "$(curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/pkg.sh)"
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Failed to initialize JavaFX

Post by cheaters »

Red. Sorry for the very late reply. Are you saying I can no longer use my AMC script in Plex?

Terminal gives me this output:

Code: Select all

admin$ sh -xu <<< "$(curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/pkg.sh)"
+ VERSION=4.8.2
+ URL=https://get.filebot.net/filebot/FileBot_4.8.2/FileBot_4.8.2.pkg
sh: line 5: TMPDIR: unbound variable

and:

Code: Select all

admin$ brew cask zap filebot
Error: Cask 'filebot' is not installed.
and when I try to launch FileBot from Mac Applications I get this error:
Image

checking java version:

Code: Select all

 admin$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

If the pkg.sh script doesn't work for you, then just download the PKG installer and double-click on it to install the normal way.

You have failed to install the PKG because it errors out for some odd reason:

Code: Select all

sh: line 5: TMPDIR: unbound variable
:idea: How can $TMPDIR not work? Are you using some sort of strange shell? $TMPDIR is typically always defined on any shell on any OS.

:idea: The brew cask package requires Java 10 specifically, but that has been replaced already, so bad luck, can't use the brew cask version. The pkg version includes it's own JRE so you'd never get this error message with the pkg version.

:idea: After running brew cask zap, you shouldn't be able to launch filebot at all, since zap would remove all app files, kinda strange that it would still be around afterwards. That doesn't make sense. Maybe you manually copied the tar archive? Anyway, use the PKG instead. Maybe manually remove all versions of FileBot you have installed first just to avoid confusion.
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Failed to initialize JavaFX

Post by cheaters »

Regarding $TMPDIR on MacOS. I ran "su admin" from my non-admin user account before running your command. Apparently, Terminal didn't like that, and didn't grant access or couldn't find the Temp directory - strange. When running the same command directly from my Admin account the command completed correctly. However, it installed into a folder titled "FileBot.launcher". I remember now, that last time I installed the pkg I thought this strange and deleted it; thinking it was a remnant from some other installation gone bad.

Image

The brew installed version wasn't around before or after I ran brew cask zap. I was just showing you that it wasn't installed to remove it from your equation. ;)

Now, in my AMC script, I should provide the path to the filebot.sh inside the pkg :?:

Yes! Working again after months. Was too busy/lazy to try and figure it all out again.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

The app should be installed to /Applications/FileBot.app and I have no idea why macOS would add this strange extra folder. The PKG installer will link the filebot.sh script into the $PATH so you should be able to call filebot by typing filebot.
:idea: Please read the FAQ and How to Request Help.
Phatty
Posts: 9
Joined: 01 May 2019, 15:17

Re: Failed to initialize JavaFX

Post by Phatty »

Hi I followed the very helpful steps shown below as I was getting the failed to initialize JavaFX error but it the app still seemed to show, now after installing openJFX it opens for a second then closes and dumps an error log.
should I PM someone the error log?

Code: Select all

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb7200a937c, pid=10305, tid=0x00007fb6f9ffc700
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b08) (build 1.8.0_242-8u242-b08-1~deb9u1-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libgdk-x11-2.0.so.0+0x4e37c]  gdk_display_open+0x5c
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007fb6fc676000):  JavaThread "SwingWorker-pool-3-thread-1" daemon [_thread_in_native, id=10333, stack(0x00007fb6f9efc000,0x00007fb6f9ffd000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000114

Registers:
RAX=0x0000000000000000, RBX=0x00007fb6e8086260, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x00007fb6f9ff9c10, RBP=0x00007fb6f9ff9c20, RSI=0x00007fb7200a9170, RDI=0x00007fb6e8086260
R8 =0x00007fb6e80957e0, R9 =0x0000000000000000, R10=0x0000000000000073, R11=0x0000000000000000
R12=0x00007fb6f9ff9c50, R13=0x00007fb6e8084f68, R14=0x00007fb6e8084f70, R15=0x00007fb6d9114cf0
RIP=0x00007fb7200a937c, EFLAGS=0x0000000000010246, CSGSFS=0x002b000000000033, ERR=0x0000000000000006
  TRAPNO=0x000000000000000e
The error log is LONG so didn't include it all.

Any ideas? Also I used the terminal to install so all I get is a .sh file in a folder that I use to run it, any way of getting to look like a popper app like the rest of my apps rather than a shortcut to an .sh file that asked if I wan to run ot run in terminal every time I click it?
ShakaZ2005 wrote: 31 Jan 2018, 18:37 Hello,

I'm using Filebot 4.7.9 on Linux Mint.
It has been working fine for a few weeks till today, where on launch the following error popped up : "Failed to initialize JavaFX. Please install JavaFX." Subsequently Filebot fails to rename any file, while generating another JavaFX error.

This post suggest the following solution if you are using OpenJDK :

Code: Select all

sudo apt-get install openjfx
This didn't work for me at first, though i can confirm it works if openjdk is indeed selected as default. You can check this with :

Code: Select all

sudo update-alternatives --config java
in my case the output is
There are 4 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 manual mode
* 4 /usr/lib/jvm/java-ibm-x86_64-80/jre/bin/java 80 manual mode
Result of further testing reveals :
java-ibm-x86_64-80 --> doesn't work even with openjfx installed
java-8-openjdk-amd64 --> works with openjfx
java-8-oracle --> works even without openjfx

Enjoy
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

:?: What does filebot -script fn:sysinfo say?


Please try the official repository to ensure you get all the dependencies as well:
https://www.filebot.net/linux/apt.html


If you're on x86_64, then you can also try the latest all-in-one package which does include JavaFX binaries which are known to work:
https://get.filebot.net/filebot/BETA/Fi ... _amd64.deb


:idea: The core dump indicates that your JavaFX package is broken. Might be a problem with your package build, so you could try to contact the package maintainers for your platform. Might be a problem with JavaFX upstream for your specific platform so you could try to contact the JavaFX developers.
:idea: Please read the FAQ and How to Request Help.
Phatty
Posts: 9
Joined: 01 May 2019, 15:17

Re: Failed to initialize JavaFX

Post by Phatty »

rednoah wrote: 19 Feb 2020, 10:39 :?: What does filebot -script fn:sysinfo say?


Please try the official repository to ensure you get all the dependencies as well:
https://www.filebot.net/linux/apt.html
I have tried both methods listed, when I run the sh file it gives me the following error:

Code: Select all

N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://get.filebot.net/deb/dists/universal-jdk8/InRelease  
E: Some index files failed to download. They have been ignored, or old ones used instead.
+ sudo apt-get install --install-recommends -y filebot
And when I add the URL to the APT repo the apt-update breaks until I remove it again.
rednoah wrote: 19 Feb 2020, 10:39 If you're on x86_64, then you can also try the latest all-in-one package which does include JavaFX binaries which are known to work:
https://get.filebot.net/filebot/BETA/Fi ... _amd64.deb
So after running this filebot deb seems to open now and has an error:

Code: Select all

Failed to open URI: https://www.filebot.net/getting-started/embed.html#deb
rednoah wrote: 19 Feb 2020, 10:39 :idea: The core dump indicates that your JavaFX package is broken. Might be a problem with your package build, so you could try to contact the package maintainers for your platform. Might be a problem with JavaFX upstream for your specific platform so you could try to contact the JavaFX developers.
Ah its the default Debian image provided when creating a VM in GCP with Cinnamon GUI.
Here is the tut for anyone curious about spinning up a VM in the cloud:
https://cloud.google.com/solutions/chro ... ute-engine
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to initialize JavaFX

Post by rednoah »

No idea. GCP is completely untested. I guess there's some significant differences compared to a typical Debian image. Not much we can do about this in the FileBot code base anyway. A bit of Googling might reveal some kind of workaround though, as this problem wouldn't be limited to FileBot, but apply generically to all Java Swing / JavaFX GUI applications.
:idea: Please read the FAQ and How to Request Help.
Phatty
Posts: 9
Joined: 01 May 2019, 15:17

Re: Failed to initialize JavaFX

Post by Phatty »

That's fair, I assumed it was just a vanilla distro with GCP tools installed, don't see why it would need to be any different.
I recommend a GCP VM as a good testing ground, you get $300 free GCP usage and if you make your VM small enough it ends up being in the free tier.

Anyway, thanks for the help that last 4.9 distro seemed to do the trick all working now except that random error that I am not feeling any impact for.
Zotarios
Posts: 3
Joined: 04 Feb 2020, 23:12

Re: Failed to initialize JavaFX

Post by Zotarios »

If someone still have issues:

This is specific for Linux users but may be valid for Windows too. I worked like a charm for me, on FileBot 4.7.9.

If you having openjfx errors, try using this java version. If you don't want to change java alternatives, download the .tar.gz version and just place the java inside it in the filebot folder (either /usr/share/filebot/ or portable). Then update the filebot.sh and add ./ before the java in the last line (so you will use that java version).
Post Reply