Incompatible with Java 8

Issue #55 new
Adam Carroll created an issue

This is a new problem caused by testing the latest version under Java 8 by updating my Gradle build with the following:

compile 'de.jensd:fontawesomefx-fontawesome:4.7.0-9'

This generates the following exception:

Caused by: java.lang.UnsupportedClassVersionError:
de/jensd/fx/glyphs/fontawesome/FontAwesomeIconView has been compiled by a more recent version of the Java Runtime (class file version 53.0),
this version of the Java Runtime only recognizes class file versions up to 52.0

It would be great to have this working on Java 8 as well as Java 9.


Comments (11)

  1. Axel Howind


    this is also an issue for me, and I'd like to do something about it. There are two problems:

    1. The class version of 4.7.0-9 is incompatible with Java 8.
    2. When compiling with Java 8, a module-info cannot be compiled
    3. An internal API is used both in the Java 9 branch and in master.

    I think I can solve 1. and 2., but 3. has to be solved first (also Java 8 compiled applications will not be able to run on Java 9+ JREs).

    I have created a replacement that does not rely on internal APIs and thus also solves the "Illegal Access" message on startup when using Java 9.

    It works by parsing the sizestring and taking into account the different units of measurement.

    Second file is, a simple test class (nt using JUnit or any framework) where I copied the original code and that outputs the result of both the internal API code and my replacement.

    If you find any case not covered by my code, please let me now and I will implement/fix the code.

    Once this is done, it should be possible to create a release that works on both Java 8 and 9. I'd then proceed to step 2, i.e. adapting the gradle build so that a Java 8 compatible library is created that also contains a valid for use in modularized Java 9 builds.

  2. Axel Howind

    OK, I had problems with the signing plugin. Once solved, I will build and test and if successful provide a patch against branch 9.1.2 (which seems to be quite ahead of master).

  3. Axel Howind

    Ok, I forked the project on Github, replaced GlyphIconUtils, updated the gradle files, created a new version that I called 9.1.2-jdk8 and published the artifacts on my own bintray account.

    After compiling my application with JDK 8, it runs unchanged with JDK 8, 9, and 10-rc.

    Please test and comment. If everything works, I will create a patch against the 9.1.2 branch.

    You can find my patched version at bintray. I will not upload to Mavencentral, but you can test by adding my bintray repo and changing the requested version from "9.1.2" to "9.1.2-jdk8".

  4. Axel Howind

    I created a patch from my changes that should fix the issues #27, #52#, #54, and #55. Binaries should be compatible with JDK 8 - 10 (module-info is there but will be ignored by Java 8).

  5. dgelessus

    Any update on this @Jerady? I am working on an application that uses FontAwesomeFX and we would like to support both Java 8 and Java 9+, which is not really possible until this is fixed.

    Thank you to @xzel23 for the patch, it seems to be working well. But in the long term it would be better to have this merged into the official repo, so we don't have to use an unofficial fork forever.

  6. Alexandr Fedorov

    Is there a plan to fix this issue? It is basically impossible to use it with java 8 that is still used in a lot of applications

  7. Log in to comment