Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems running a javafx application, Netbeans 11, java 12, javafx 13

Trying to run a simple hello world example but getting the following error, which I do not understand:

Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

How to solve it? Do I need some libs, plugins, configs which are not yet included?

Here is my pom: Tried using Java 9,10,11,12 and JavaFX 12 & 13 and get the same error.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany</groupId>
<artifactId>mavenproject3</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>11</maven.compiler.release>
    <javafx.version>13</javafx.version>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <release>${maven.compiler.release}</release>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>0.0.4</version>
            <configuration>
                <mainClass>com.mycompany.mavenproject3.MainApp</mainClass>
                <executable>C:\Program Files\Java\jdk-12\bin\java</executable>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>${javafx.version}</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>${javafx.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->


    <!-- https://mvnrepository.com/artifact/eu.hansolo/Medusa -->
    <dependency>
        <groupId>eu.hansolo</groupId>
        <artifactId>Medusa</artifactId>
        <version>11.2</version>
    </dependency>

    <dependency>
        <groupId>eu.hansolo</groupId>
        <artifactId>colors</artifactId>
        <version>1.4</version>
    </dependency>

</dependencies>

like image 999
wannaBeDev Avatar asked Oct 15 '22 05:10

wannaBeDev


1 Answers

That is a bug in the dependency eu.hansolo:Medusa:11.2, as it depends on mac version of JavaFX and hence the modulepath will contain both win and mac versions of JavaFX:

<dependency>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-controls</artifactId>
  <version>12.0.1</version>
  <classifier>mac</classifier> <---------------
  <scope>runtime</scope>
</dependency>
<dependency>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-base</artifactId>
  <version>12.0.1</version>
  <classifier>mac</classifier>  <---------------
  <scope>runtime</scope>
</dependency>
<dependency>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-graphics</artifactId>
  <version>12.0.1</version>
  <classifier>mac</classifier>  <---------------
  <scope>runtime</scope>
</dependency>

That was fixed in version 11.3:

  • Updated some libraries and removed the org.openjfx classifier

The solution:

Just update eu.hansolo:Medusa:11.2 to eu.hansolo:Medusa:11.3 and it should work.

like image 115
Eng.Fouad Avatar answered Oct 19 '22 00:10

Eng.Fouad