Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

"Unsupported class file error" on a Vaadin 14 project

I have an old Vaadin14 project that used to work with java 1.8.

I have upgraded my Linux distribution and now the java version 21.

The issue now is when I try to build the project (with mvn package -Pproduction), I get the following error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:14.9.5:build-frontend (default) on project org-cubr-ui-vaadin: Execution default of goal com.vaadin:vaadin-maven-plugin:14.9.5:build-frontend failed: Unsupported class file major version 65 -> [Help 1]

So I installed java 1.8 and made it the default version with update-alternatives --config java but I have still the same error while building the project.

Question 1: Why maven doesn’t use the java version configured with update-alternatives ? Do I have something to modify in the pom.xml file ?

Question 2: Is it even possible to build a Vaadin14/maven project on a recent distrib (I mean with a recent java version) ?


Update: when launching maven with option -X, I can see at the very beginning that java 21 is used.

>Solution :

You need to set JAVA_HOME environment variable to correct path.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading