Java 21 Support
I am trying to deploy my Spring Boot Java 21 project but i am getting error that Java 21 is not supported. I can see that Java 21 updated and merged into Main
Project Railway Id = 0f4858db-976c-4f1a-91ea-0ba1b5fc740
This is from my Railway log
#10 37.95 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project cep-system: Fatal error compiling: error: release version 21 not supported -> [Help 1]
23 Replies
Project ID:
N/A
0f4858db-976c-4f1a-91ea-0ba1b5fc740
for a build with java 31 you would need to write yourself a custom dockerfile to deploy your app
Can you please send me documentation with some examples?
Also for Using Graavlm Native Image. Do i just need to have plugin pom.xml or aswell something extra for Railway to use it?
I don't have any docs on hand for that, though writing dockerfiles has no relation to railway so I'm sure you could find some examples. all you need to is have a
Dockerfile
in your repo and railway will use it
if you are writing your own dockerfile then that is up to youOkay thank you very much for follow up!
If you dont support Java 21, what does this PR do?
https://github.com/railwayapp/nixpacks/pull/1020
GitHub
Add support for Java 20/21 in Java & Scala Providers by marcosperei...
What?
This PR adds Java 20 and 21 support in Java and Scala providers.
Specifically for Scala, it also updates the Eclipse Temurin images to the latest
versions.
Tests are added/updated if needed...
supports java 20/21?
So are the Nixpacks docs wrong here or is it Railway doesn't yet use the available Nixpacks? Railway docs link to this page: https://nixpacks.com/docs/providers/java that explicitly says JDK 21 is supported.
EDIT: Java 31 was miss spell. I meant 21
The version can be overridden by setting the NIXPACKS_JDK_VERSION environment variable.
That doesn't work on my Maven Java 21 project
5c9217a3-e7e4-47db-97fa-19d27bec5d65
you may need a dockerfile then
So then the Railway Nixpack docs are incorrect? And Railway does not support JDK 21?
I'm not sure, sorry
Is there someone who might know better? It seems clear this is supposed to work given the merged PR #1020 from above.
I understand this is a holiday weekend, so I'm fine with waiting until next week for more details.
@aleks would know
It looks like you're using Maven, is that correct?
Ah, it looks like the Java 20 & 21 support hasn't made it into a release yet, I'm afraid you'll have to wait for a new version and use a dockerfile in the meantime
thank you!!
I'm afraid I'm really not that familiar with Maven, but you could probably modify https://github.com/aleksrutins/springboot-java/blob/master/Dockerfile (uses gradle) to fit your needs
GitHub
springboot-java/Dockerfile at master · aleksrutins/springboot-java
Contribute to aleksrutins/springboot-java development by creating an account on GitHub.
What do you mean by that? What release doesn't include these versions? A nixpacks release?
Correct