Reputation: 1535
I have code that uses Java 17 features and I am using JDK 17. Is it possible to make a JAR file with bytecode from this Java code that will be executable in 32b JRE 1.8?
Upvotes: 1
Views: 105
Reputation: 11934
Unfortunately, no.
You can instruct the compiler to generate bytecode for java 8, but then you can not use language features that were introduced after java 8. If you attempt to do so, your code will not compile.
Here are some details how to specify the target java version maven's pom.xml
file.
Your only option is to re-write your code so that it compiles with java 8.
Upvotes: 3