Skip to content

Compile to older JDK (run on Java 21, but generate Java 17 classes) #3693

Closed Answered by laeubi
chrislake asked this question in Q&A
Discussion options

You must be logged in to vote

Set the "Compiler compliance level" to Java 17;
Keep the .classpath (JRE_CONTAINER) files to require "StandardVMType/JavaSE-17"
Update the Target (targetJRE) and Manifest.MF (RequiredExecutionEnvironment) files to require "JavaSE-21"

These are two contradictory settings (even though it theoretically works) as you say your bundle requires Java 21 bytecode but you compile to Java 17 ... You can run any BREE 17 bundle on Java 21 so why enforce it if you want be compatible with Java 17?

So at a first sight there is some chance to confuse the tools by giving different configurations, so what benefit do you expect from requiring Java 21 as BREE?

Technically without special configuration, Tych…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by chrislake
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants