B4J Tutorial Install OpenJRE8 with OpenJFX on Ubuntu (Linux)

Hey, i had some trouble with OpenJRE8 and this was the solution.

This Tutorial help you, if you have for example this error:
B4X:
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/scene/image/Image

1. Download Java JRE 8 (in most cases you will need the Linux version):
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

2. type this in the terminal or console:
  • sudo mkdir /usr/lib/jvm
  • cd /usr/lib/jvm
  • sudo tar -xvzf /home/admin/jre-8u201-linux-x64.tar.gz
  • sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_201/bin/java" 0
  • sudo update-alternatives --set java /usr/lib/jvm/jre1.8.0_201/bin/java
  • update-alternatives --list java
  • java -version
  • sudo apt-get install openjfx
and now you can use OpenJRE8 with OpenJFX.

Tips:
-replace the path with your path
sudo tar -xvzf /home/admin/jre-8u201-linux-x64.tar.gz
 

xulihang

Active Member
Licensed User
Longtime User
  • sudo apt-get install openjfx
and now you can use OpenJRE8 with OpenJFX.

I think the oracle jre 8 should have javafx bundled and there is no need to install openjfx. The jre downloaded from oracle is different from openjre.
 
Top