R
Railway7mo ago
Firefox

Won't let me use Java 8 or higher?

I am currently using Java with railway, and I keep running into this frustrating error when it comes to deploying. The program will begin to deploy, a Nixpacks messages will show up telling me I am running Java 17, Maven dependencies will download. Then after a bit, I will get a compilation error stating lambda expressions are not supported in -source 7 (use -source 8 or higher to enable lambda expressions) This is strange because it previously told me that I was using Java 17. I have idea how it make it do -source 8 instead of -source 7 , because I can't find it anyhwere. Any help would be greatly appreciated
No description
No description
Solution:
I had to set
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
to ```<maven.compiler.source>1.8</maven.compiler.source>...
Jump to solution
3 Replies
Percy
Percy7mo ago
Project ID: 734d8e92-1ffe-4028-9619-90c7d0dfc926
Firefox
Firefox7mo ago
734d8e92-1ffe-4028-9619-90c7d0dfc926 nvm fixed
Solution
Firefox
Firefox7mo ago
I had to set
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
to
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>