Did I build Java 10 wrong or is it something else? Running MapTool on Pi4 (nearly! something wrong with InteropFactoryN?)

177 Views Asked by At

I'm looking for a bit of Java help here.

I am trying to run MapTool on a Raspberry Pi 4. No mean feat -- I've installed ubuntu server, so I could get a 64 bit operating system. Then I had to build OpenJDK-9 so I could build OpenJDK-10 (a weekend I won't be getting back -- Maptool requires JDK10). Then I was ready to follow the instructions posted here: https://www.reddit.com/r/MapTool/comments/evua2p/maptool_on_the_raspberry_pi/

Those steps said:

1- download the JavaFX 11 Linux SDK (not armv6hf SDK) from here: https://gluonhq.com/products/javafx/

  1. extract the zip and put the lib folder into the same folder where the MapTool jar is (here ~/MapTool/lib )

  2. to run MapTool, open a terminal there (~/MapTool/) and execute in a single line java -cp "MapTool-1.7.0.jar:lib/*" net.rptools.maptool.client.LaunchInstructions

That almost worked. I get this error:

21:54:03.013 (MapTool.java:1555) [main] INFO net.rptools.maptool.client.MapTool - AppHome System Property: /home/ubuntu/.maptool/logs
21:54:03.016 (MapTool.java:1556) [main] INFO net.rptools.maptool.client.MapTool - Logging to: /home/ubuntu/.maptool/logs/maptool.log
21:54:03.020 (MapTool.java:1563) [main] INFO net.rptools.maptool.client.MapTool - getting MapTool version from manifest: 1.7.0
21:54:03.026 (MapTool.java:1568) [main] INFO net.rptools.maptool.client.MapTool - getting MapTool vendor from manifest: rptools
21:54:03.403 (MapTool.java:1638) [main] INFO net.rptools.maptool.client.MapTool - MapTool version: 1.7.0
21:54:03.405 (MapTool.java:1641) [main] INFO net.rptools.maptool.client.MapTool - MapTool vendor: rptools
InteropFactory: cannot load com.sun.javafx.embed.swing.newimpl.InteropFactoryN
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:251)
at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:267)
at net.rptools.maptool.client.swing.SplashScreen.<init>(SplashScreen.java:36)
at net.rptools.maptool.client.MapTool.main(MapTool.java:1693)
at net.rptools.maptool.client.LaunchInstructions.main(LaunchInstructions.java:50)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:844)

I'm guessing I either need to add some argument to the launch command or I didn't build the image for JDK10 completely. Can anyone help?

2

There are 2 best solutions below

4
Frank On

Do you really need to build the JDK yourself? BellSoft, AdoptOpenJDK, Azul all provide different JDK's you can install on ARM. For some more info and install scripts for BellSoft LibericaJDK, check https://webtechie.be/post/2020-04-08-installing-java-and-javafx-on-raspberry-pi/

0
TheDougMiester On

So, in the end, as of this date (18 Jul 2020) it doesn't make sense to use Ubuntu server for the Pi 4 -- too much work for not enough speed payoff. A guy on reddit got it working using the 32 bit Raspian release. I'm reposting his guidelines below . They work. https://www.reddit.com/r/MapTool/comments/evua2p/maptool_on_the_raspberry_pi/

download the MapTool 1.7 .jar version and save it in a new folder (e.g. ~/MapTool/MapTool-1.7.0.jar)

remove any currently installed OpenJDK versions sudo apt purge openjdk*

install OpenJDK version 10 (MapTool still uses SDK version 10 at least for compilation) sudo apt install openjdk-10-jdk

download the JavaFX 11 Linux SDK (not armv6hf SDK) from here: https://gluonhq.com/products/javafx/

extract the zip and put the lib folder into the same folder where the MapTool jar is (here ~/MapTool/lib)

to run MapTool, open a terminal there (~/MapTool/) and execute in a single line java -cp "MapTool-1.7.0.jar:lib/*" net.rptools.maptool.client.LaunchInstructions (put spaces where there are linebreaks in this text)

to make launching more convenient, put the command in an executable bash file