1

I got java JDK 11 installed and I am using the Maven JavaFX. But when I try and run the code I get a build error which is "class file has wrong version 54, should be 52"

POM.xml

<dependencies>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>11.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-fxml -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>11.0.2</version>
    </dependency>

    <dependency>
        <groupId>com.ibm.watson.developer_cloud</groupId>
        <artifactId>java-sdk</artifactId>
        <version>6.14.0</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1.1</version>
    </dependency>
</dependencies>
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
Jordfoz16
  • 27
  • 1
  • 5
  • 3
    You're compiling with target version 8, but your dependencies are compiled with target version 10. – fabian Feb 09 '19 at 20:13

1 Answers1

3

Make sure you are using Java 11 for compilation and the language level is set to 10 or higher. Check this answer for the details how to configure the language level in IntelliJ IDEA for Maven.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904