Best Cosmetic Hospitals Near You

Compare top cosmetic hospitals, aesthetic clinics & beauty treatments by city.

Trusted • Verified • Best-in-Class Care

Explore Best Hospitals

How to Fix UnsupportedClassVersionError When Running Keycloak

How to Fix UnsupportedClassVersionError When Running Keycloak

When launching self-hosted applications like Keycloak, you might encounter specific errors related to your system’s environment. One common issue is the java.lang.UnsupportedClassVersionError, which can halt the startup process. This error indicates a mismatch between the Java version your application was built with and the version installed on your server.

This article walks you through diagnosing and resolving this error, using a real-world example from a user trying to run Keycloak.

The Problem: UnsupportedClassVersionError

After a fresh installation of Keycloak, a user attempts to launch it using the start-dev command:

bashroot@Abhishek:/opt/lampp/htdocs/keycloak-26.3.3# bin/kc.sh start-dev

Instead of starting successfully, the system returns the following error:

textError: LinkageError occurred while loading main class io.quarkus.bootstrap.runner.QuarkusEntryPoint
        java.lang.UnsupportedClassVersionError: io/quarkus/bootstrap/runner/QuarkusEntryPoint has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

This error message is very specific and tells us exactly what is wrong. Let’s break it down.

Understanding the Error

The java.lang.UnsupportedClassVersionError means the Java Virtual Machine (JVM) is trying to load a class file that was compiled with a newer version of Java than the JVM itself supports.

From the error output, we can identify two key pieces of information:

  • class file version 61.0: This is the version format of the application’s compiled code (in this case, for Keycloak). This version number corresponds to Java 17.
  • class file versions up to 55.0: This is the latest class file version that the currently installed Java runtime can understand. This version number corresponds to Java 11.

The conflict is clear: Keycloak requires Java 17 to run, but the server is using Java 11.

Step-by-Step Solution on Ubuntu

To fix this, you must upgrade the Java environment on your server to a compatible version. Here’s how to install Java 17 and set it as the default on an Ubuntu system.

Step 1: Install Java 17

First, you need to install the OpenJDK 17 package. Open your terminal and run the following commands.

  1. Update your package list: This ensures you are getting the latest available packages from the repository. bashsudo apt update
  2. Install OpenJDK 17: This command downloads and installs the Java 17 Development Kit (JDK). bashsudo apt install openjdk-17-jdk

Step 2: Set Java 17 as the Default Version

If you have more than one version of Java installed, you must tell the system which one to use by default.

  1. Run the update-alternatives command: bashsudo update-alternatives --config java
  2. This will display a list of all Java versions installed on your system. You will be prompted to select a version. Enter the number corresponding to the OpenJDK 17 installation and press Enter.

Step 3: Verify the New Java Version

After the installation and configuration are complete, it’s important to verify that your system is now using the correct Java version.

Run the following command:

bashjava -version

The output should now display information indicating you are running OpenJDK version 17.

Step 4: Rerun the Keycloak Script

With Java 17 now active, you can return to your Keycloak directory and run the startup command again.

bashbin/kc.sh start-dev

Best Cardiac Hospitals Near You

Discover top heart hospitals, cardiology centers & cardiac care services by city.

Advanced Heart Care • Trusted Hospitals • Expert Teams

View Best Hospitals
<p data-start="140" data-end="435">I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with <a class="decorated-link" href="https://www.cotocus.com/" target="_new" rel="noopener" data-start="300" data-end="335">Cotocus</a> and continue to contribute to multiple platforms where I share insights across different domains:</p> <ul data-start="437" data-end="922"> <li data-start="437" data-end="514"> <p data-start="439" data-end="514"><a class="decorated-link" href="https://www.devopsschool.com/" target="_new" rel="noopener" data-start="439" data-end="485">DevOps School</a> – Tech blogs and tutorials</p> </li> <li data-start="515" data-end="599"> <p data-start="517" data-end="599"><a class="decorated-link" href="https://www.holidaylandmark.com/" target="_new" rel="noopener" data-start="517" data-end="569">Holiday Landmark</a> – Travel stories and guides</p> </li> <li data-start="600" data-end="684"> <p data-start="602" data-end="684"><a class="decorated-link" href="https://www.stocksmantra.in/" target="_new" rel="noopener" data-start="602" data-end="647">Stocks Mantra</a> – Stock market strategies and tips</p> </li> <li data-start="685" data-end="764"> <p data-start="687" data-end="764"><a class="decorated-link" href="https://www.mymedicplus.com/" target="_new" rel="noopener" data-start="687" data-end="732">My Medic Plus</a> – Health and fitness guidance</p> </li> <li data-start="765" data-end="841"> <p data-start="767" data-end="841"><a class="decorated-link" href="https://www.truereviewnow.com/" target="_new" rel="noopener" data-start="767" data-end="814">TrueReviewNow</a> – Honest product reviews</p> </li> <li data-start="842" data-end="922"> <p data-start="844" data-end="922"><a class="decorated-link" href="https://www.wizbrand.com/" target="_new" rel="noopener" data-start="844" data-end="881">Wizbrand</a> – SEO and digital tools for businesses</p> </li> </ul> <p data-start="924" data-end="1021">I’m also exploring the fascinating world of <a class="decorated-link" href="https://www.quantumuting.com/" target="_new" rel="noopener" data-start="968" data-end="1018">Quantum Computing</a>.</p>

Related Posts

A Practical Roadmap for DevSecOps Engineering, Skill Building, and Professional Certification

High-velocity deployment workflows have completely reshaped how digital products are built and managed. Between distributed cloud infrastructure, microservice topologies, and automated build pipelines, organizations regularly ship application…

Read More

Practical DevSecOps and Software Supply Chain Defense for Cloud Infrastructure

Modern engineering organizations have largely transitioned to distributed cloud platforms, microservice topologies, and fully automated deployment pipelines to accelerate release cadences. While this transition drastically cuts time-to-market,…

Read More

Engineering Continuous Delivery: A Strategic Roadmap to Cloud Automation and Infrastructure Management

The ongoing evolution of cloud infrastructure has completely redefined how digital applications are built, deployed, and sustained at scale. Maintaining high-speed deployment schedules while ensuring system availability…

Read More

A Practical Masterclass in Container Orchestration, DevSecOps, and Cloud Automation

Architecting high-availability cloud platforms demands a durable, adaptive operational strategy. As digital enterprises evolve beyond rigid legacy systems into microservices architectures, managing container fleets, securing continuous deployment…

Read More

DevOps Consultants Streamline Workflows and Boost Engineering Efficiency

In modern software organizations, developers frequently lose valuable time to operational friction, such as slow builds, manual deployments, infrastructure requests, and environment inconsistencies. DevOps consultants are specialist…

Read More

DevOps Consultants Look for in Your Pipeline: A Complete Assessment Guide

Introduction When software delivery slows down or production incidents pile up despite modern tooling, organizations often bring in an external perspective to diagnose root causes. An experienced…

Read More
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x