monarch-initiative / PhenoteFX

PhenoteFX
https://monarch-initiative.github.io/PhenoteFX/
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

error when trying to launch PhenoteFX 0.9 on my Mac #111

Closed azankl closed 1 year ago

azankl commented 1 year ago

I downloaded the latest release from Github, but nothing happens when I double-click on it. I tried launching via the command line and get the errors below. I am running MacOS Ventura 13.4.1 on a MacBookPro (M1 chip) with Java OpenJDK 20.0.1 installed via Homebrew (I included java version message at the end of error message below). Is this a configuration error on my side or a bug on your side? Thanks Andreas

azankl@MacBookProAZ ~ % java -jar /Applications/PhenoteFX.jar July 27, 2023 2:26:02 PM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6cd8737' 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:283) at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253) at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:263) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:1623) Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125) ... 1 more Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) Caused by: java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:275) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:1623) azankl@MacBookProAZ ~ % java -version openjdk version "20.0.1" 2023-04-18 OpenJDK Runtime Environment Homebrew (build 20.0.1) OpenJDK 64-Bit Server VM Homebrew (build 20.0.1, mixed mode, sharing) azankl@MacBookProAZ ~ %

ielis commented 1 year ago

Hi @azankl Java software is usually cross-platform and Java creators also rightfully boast regarding the backward compatibility of the language. Thanks to this, arcane Java code written using Java 1.5 syntax is expected to run even on the latest Java Runtime Environment.

Unfortunately, this is not the case with the software that uses JavaFX - the most recent addition to previously used Java GUI frameworks AWT and Swing. Building JavaFX apps can be more problematic and builds that target specific platform-JRE version may be necessary. I also heard about Apple M1 chips requiring extra care which adds another complexity layer. This is a subject for a longer debate..


Anyway, this looks like an issue on our side. I would suggest to try to build the app on your machine. To simplify the build, I created a branch with Maven Wrapper. Thanks to this, you should be able to build the app without having to install Apache Maven before the build - one less thing to do. :)

So running the following in Terminal should work:

# Clone the repo to your machine and enter the repo
git clone https://github.com/monarch-initiative/PhenoteFX.git
cd PhenoteFX

# Checkout the branch with Maven wrapper
git checkout add-maven-wrapper && git pull

# Build the app
./mvnw clean package

# Run the freshly built app
java -jar target/PhenoteFX.jar

If the app starts, then please look up the target/PhenoteFX.jar file and try to double-click. If this works, then feel free to copy the JAR file to any other folder on your machine and use it.

I hope this helps and all the best, Daniel

azankl commented 1 year ago

Hi Daniel, Followed your instructions and everything seems to work. There were a few warnings during the first launch, not sure if they are important. I attach the log file: log.txt Thanks Andreas

ielis commented 1 year ago

Hi Andreas, I think the log is OK. It is normal to see many JARs being downloaded during the first build. Then, the logging warnings and this:

Aug 04, 2023 10:46:47 AM com.sun.javafx.application.PlatformImpl startup 
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6cd8737' 

do not have any impact on the logic. That's how the app works as of now.

I'm glad that it worked, please let us know if there are any other issues.

Thanks, Daniel