# Jakarta ServletConfig gives wrong version error

**URL:** <https://discourse.dojo.io/t/jakarta-servletconfig-gives-wrong-version-error/654>\
**Category:** DWR users\
**Created:** [April 18, 2025, 3:34pm UTC](https://discourse.dojo.io/t/jakarta-servletconfig-gives-wrong-version-error/654 "2025-04-18T15:34:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NelsonPurcell](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NelsonPurcell](https://discourse.dojo.io/u/NelsonPurcell)\
**Post date:** [April 18, 2025, 3:34pm UTC](https://discourse.dojo.io/t/jakarta-servletconfig-gives-wrong-version-error/654/1 "2025-04-18T15:34:04Z")

</div>

I just cloned dwr-2024 from the [GitHub repo](https://github.com/olddimplex/dwr-2024) ‘master’ branch. I ran `$ ant jar` from the repo root, and build compilation failed with this error:

```auto
    [javac] Compiling 195 source files to .../dwr-2024/target/ant/classes/main
    [javac] .../dwr-2024/core/api/main/java/org/directwebremoting/ServerContext.java:5: error: cannot access ServletConfig
    [javac] import jakarta.servlet.ServletConfig;
    [javac] ^
    [javac] bad class file: .../dwr-2024/target/ant/lib/jakarta.servlet-api-6.1.0.jar(jakarta/servlet/ServletConfig.class)
    [javac] class file has wrong version 55.0, should be 52.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.

```

It doesn’t look like this is something I can fix. Can anyone here help?

I’m using Java openjdk version “1.8.0\_442” on Ubuntu 22.04.

Thank you.

---

<div class="post-metadata">

**Author:** ![lucasjohnson](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lucasjohnson](https://discourse.dojo.io/u/lucasjohnson)\
**Post date:** [November 15, 2026, 6:10pm UTC](https://discourse.dojo.io/t/jakarta-servletconfig-gives-wrong-version-error/654/2 "2026-11-15T18:10:11Z")

</div>

The error means the servlet API jar was compiled for Java 11 (class file 55), while your javac is Java 8 (52). Run Ant with JDK 11 or newer, not just change source/target: set JAVA\_HOME to the newer JDK, put its bin first on PATH, then run ant clean jar. If the project must build on Java 8, replace that dependency with a Java 8-compatible servlet API version, but DWR’s current master may simply require a newer JDK.
