# Support for Java17

**URL:** <https://forum.keycloak.org/t/support-for-java17/10995>\
**Category:** Miscellanaeous\
**Created:** [September 14, 2021, 6:42pm UTC](https://forum.keycloak.org/t/support-for-java17/10995 "2021-09-14T18:42:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![pravsjv](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@pravsjv](https://forum.keycloak.org/u/pravsjv)\
**Post date:** [September 14, 2021, 6:42pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/1 "2021-09-14T18:42:17Z")

</div>

Hi team,

Any idea on Keycloak support for Java 17.

Thanks!!

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 14, 2021, 6:55pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/2 "2021-09-14T18:55:58Z")

</div>

Have you tried it? There are not “officially supported” versions of Java/DB/etc. for Keycloak, just minimums. If it works, you should be fine.

---

<div class="post-metadata">

**Author:** ![pravsjv](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@pravsjv](https://forum.keycloak.org/u/pravsjv)\
**Post date:** [September 14, 2021, 7:43pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/3 "2021-09-14T19:43:55Z")

</div>

haven’t tried it yet… wanted to check if keycloak has any plans supporting it.

---

<div class="post-metadata">

**Author:** ![amruthnaveen14](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amruthnaveen14](https://forum.keycloak.org/u/amruthnaveen14)\
**Post date:** [September 16, 2021, 2:15pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/4 "2021-09-16T14:15:50Z")

</div>

@xgp - What Latest Java version does Keycloak support?

currently, in Keycloak 15 Version I still see it support Java 8 JDK  
[https://www.keycloak.org/docs/latest/server\_installation/index.html#system-requirements](https://www.keycloak.org/docs/latest/server_installation/index.html#system-requirements)

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 16, 2021, 3:23pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/5 "2021-09-16T15:23:23Z")

</div>

As I said, I don’t believe there are any “officially supported” versions. You can buy commercial support for the Redhat SSO product, and I’m sure they’d be happy to tell you which JDK versions are supported. This board is more of a community where we share our experiences.

I personally have run the current Keycloak on JDK 8 and 11 in production. I just downloaded and tried it on JDK 17 and it seems to work just fine. However, if you are planning to use it in production, I’d recommend testing it out yourself, and sharing any problems here for the benefit of the community.

---

<div class="post-metadata">

**Author:** ![amruthnaveen14](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amruthnaveen14](https://forum.keycloak.org/u/amruthnaveen14)\
**Post date:** [September 16, 2021, 6:37pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/6 "2021-09-16T18:37:58Z")

</div>

Thank you @xgp this helps us to go on the right path now. I appreciate your quick responses.

It would be more help full if you could review the question posted below and let us know your inputs.

> [@Upgrading the Keycloak from 3.4.0 to 15.0? and Recommended Stable Keycloak Version (Production Ready)](http://forum.keycloak.org/t/upgrading-the-keycloak-from-3-4-0-to-15-0-and-recommended-stable-keycloak-version-production-ready/10918):
>
> I see a lot of versions released in the span of a year or two - Is there any specific version that we need to consider for Production? My company is using the 3.4.0 Final Version, we are planning to Upgrade the Keycloak to Latest One. Is there any specific version that we need to upgrade first (Ex: 10.0) and then go with the Latest version (Ex: 15.0)? or can we directly upgrade from 3.4.0 to 15.0? Thank you for your time, Please help me out on this.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 16, 2021, 6:42pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/7 "2021-09-16T18:42:40Z")

</div>

There is no great guide for large upgrades like that. Couple of thoughts:

1. Read the official upgrade documentation: [Upgrading Guide](https://www.keycloak.org/docs/latest/upgrading/)
2. With your data from production, test incremental upgrades between versions. I.e. you _might_ be able to upgrade from 3.4.0 to X.0.0, but it also might break something unexpected. If you go one major version at a time, it will be more likely to succeed. However **test** the upgrade version steps **before** you do it in production. There have been problems reported here and the mailing list about huge upgrades like this. You want to be sure, with your real data, before running it in prod.

---

<div class="post-metadata">

**Author:** ![amruthnaveen14](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amruthnaveen14](https://forum.keycloak.org/u/amruthnaveen14)\
**Post date:** [September 16, 2021, 7:09pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/8 "2021-09-16T19:09:21Z")

</div>

Thank you @xgp for your quick response 🙂  
Is there any Stable Version that we need to consider to upgrade like 15.0 minus 2 version or should we jump on directly to Latest Version.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 16, 2021, 7:17pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/9 "2021-09-16T19:17:04Z")

</div>

That’s up to you and your testing. However, I’m aware of people running 15.0.2 in production with no problems.

---

<div class="post-metadata">

**Author:** ![claudioweiler](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/claudioweiler/32/1295_2.png) [@claudioweiler](https://forum.keycloak.org/u/claudioweiler)\
**Post date:** [September 16, 2021, 8:07pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/10 "2021-09-16T20:07:36Z")

</div>

KeyCloak is backed by WildFly, that, currently, is officially supported in Java 8 and 11. Major versions is confirmed to run with some issues.

Keycloak.X is backed by Quarkus, I can’t say anything about it.

Wildfly Team will probably upgrade to Java 17, as it is new LTS version, but it is not an easy path.

---

<div class="post-metadata">

**Author:** ![amruthnaveen14](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amruthnaveen14](https://forum.keycloak.org/u/amruthnaveen14)\
**Post date:** [September 19, 2021, 12:16am UTC](https://forum.keycloak.org/t/support-for-java17/10995/11 "2021-09-19T00:16:36Z")

</div>

Thank you @xgp and @claudioweiler for your suggestion.

Can you please help me out on this, when you get a chance… let me know if you need more details…

> [@Not able to register a custom SPI](http://forum.keycloak.org/t/not-able-to-register-a-custom-spi/1099/20):
>
> We are in process of upgrading the Keycloak from 3.4.0 to 15.0.2 After upgrading the Keycloak the server is not registering the AccessTokenIntrospectProviderFactory however it is loading the other factory classes like AutoLinkIdpLoginAuthenticatorFactory, RealmResourceProviderFactory etc… All these files were added under META-INF.services

---

<div class="post-metadata">

**Author:** ![amruthnaveen14](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amruthnaveen14](https://forum.keycloak.org/u/amruthnaveen14)\
**Post date:** [September 20, 2021, 6:19pm UTC](https://forum.keycloak.org/t/support-for-java17/10995/12 "2021-09-20T18:19:50Z")

</div>

**Update** :  
I could able to resolve this issue when I place the JAR file into KEYCLOAK\_HOME/standalone/deployments/ jar file here  
instead of "KEYCLOAK\_HOME/providers/  
Here is the references,  
[https://www.keycloak.org/docs/latest/server\_development/#using-the-keycloak-deployer](https://www.keycloak.org/docs/latest/server_development/#using-the-keycloak-deployer)

In the older version of Keycloak 3.4.0.FINAL version, the “TokenIntrospectProviderFactory” used to recognize at run time.

after that I also faced one issue that I was seeing " ERROR [org.keycloak.services.error.KeycloakErrorHandler]"

I resolved this issue by adding the below plugin in POM.xml file,  
[http://docs.wildfly.org/17/Developer\_Guide.html#ear-class-loading](http://docs.wildfly.org/17/Developer_Guide.html#ear-class-loading)

```auto
	<build>
<plugins>
	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-jar-plugin</artifactId>
		<configuration>
			<archive>
				<manifestEntries>
					<Dependencies>org.keycloak.keycloak-services</Dependencies>
				</manifestEntries>
			</archive>
		</configuration>
	</plugin>
</plugins>
	</build>

```

---

<div class="post-metadata">

**Author:** ![monj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/monj/32/343_2.png) [@monj](https://forum.keycloak.org/u/monj)\
**Post date:** [February 1, 2022, 10:00am UTC](https://forum.keycloak.org/t/support-for-java17/10995/13 "2022-02-01T10:00:52Z")

</div>

For those interested. Keycloak 16.1.0 runs fine in Java17.

I have implemented custom SPI that use advance java features such as `var` declaration, `record` classes, new pattern matching, etc. It’s all good.

---

<div class="post-metadata">

**Author:** ![cgeo7](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/cgeo7/32/4942_2.png) [@cgeo7](https://forum.keycloak.org/u/cgeo7)\
**Post date:** [February 2, 2022, 9:05am UTC](https://forum.keycloak.org/t/support-for-java17/10995/14 "2022-02-02T09:05:38Z")

</div>

Except if you’re using ABAC/JBAC

---

<div class="post-metadata">

**Author:** ![hegdekar](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/hegdekar/32/5109_2.png) [@hegdekar](https://forum.keycloak.org/u/hegdekar)\
**Post date:** [February 21, 2022, 6:34am UTC](https://forum.keycloak.org/t/support-for-java17/10995/15 "2022-02-21T06:34:47Z")

</div>

@xgp Currently I’m using Keycloak-15.0.2 (Wildfly distribution) on JDK 8. And planning to upgrade to 17.0.0.  
I wasn’t able to run Keyclok 17.0.0 (Quarkus distribution) on JDK8. With bit of digging around figured out Quarkus doesn’t support JDK 8 in their recent versions.

So does it mean I cannot run Keycloak anymore on JDK 8 ?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [February 21, 2022, 8:51am UTC](https://forum.keycloak.org/t/support-for-java17/10995/16 "2022-02-21T08:51:01Z")

</div>

Yes, that’s correct.  
Keycloak 17 runs on Java 11+

---

<div class="post-metadata">

**Author:** ![monj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/monj/32/343_2.png) [@monj](https://forum.keycloak.org/u/monj)\
**Post date:** [February 21, 2022, 8:54am UTC](https://forum.keycloak.org/t/support-for-java17/10995/17 "2022-02-21T08:54:26Z")

</div>

I’m using ABAC and it’s all good.

If you mean that the support for Nashorn is gone and you cannot run Javascript policies, I have good news: you can easily create a SPI that replaces Nashorn with graalvm

e.g. this one: [GitHub - thomasdarimont/keycloak-graalvm-js-scripting-provider: GraalVM.JS based JavaScript ScriptingProvider extension for Keycloak.](https://github.com/thomasdarimont/keycloak-graalvm-js-scripting-provider)

---

<div class="post-metadata">

**Author:** ![hegdekar](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/hegdekar/32/5109_2.png) [@hegdekar](https://forum.keycloak.org/u/hegdekar)\
**Post date:** [February 21, 2022, 9:16am UTC](https://forum.keycloak.org/t/support-for-java17/10995/18 "2022-02-21T09:16:19Z")

</div>

> [@dasniko](#):
>
> Yes, that’s correct.  
> Keycloak 17 runs on Java 11+

Thanks for the confirmation @dasniko.  
Once the Wildfly distribution completely removed there is no way to run Keycloak on JDK8 then right?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [February 21, 2022, 9:32am UTC](https://forum.keycloak.org/t/support-for-java17/10995/19 "2022-02-21T09:32:48Z")

</div>

Yes, although I also experienced some problems with KC 16+ (Legacy/Wildfly) with Java 8, which were gone when running KC Legacy with Java 11. Depends on the features one is using and it seams that the behaviour is not clearly distinct.  
So, better run you environment with more up-to-date Java versions than this old 8 release. It’s really more than outdated.
