akourt
akourt

Reputation: 5563

Java compatibility compilation mode

I'm faced with the following conundrum. I'm currently deploying a Java 8 application on both 32bit and 64bit Windows machines.

Since Java 8 is reaching it's EoL I'm starting to face the very difficult issue on what to do next.

Since Oracle will not be providing 32bit versions of their newer Java versions I have to stick to 8 for now, albeit by moving over to OpenJDK's offering which they seem to pledge to support even further than 8's EoL. For this I'll be also migrating over to OpenJ9 as a VM (which provides a 32bit version).

My question is the following though. I am starting to consider moving over to Java 11. I was wondering, would it be possible to use that jdk to compile in compatibility mode and target version 8 at the cost of not using any 11 specific features?

Also could, the compiled code run correctly in such a combination, that is Java 11 code compiled compatibly and deployed to an environment running on 32bit?

I was also wondering what are the compatibility support for Java 11.

Upvotes: 7

Views: 3776

Answers (1)

Naman
Naman

Reputation: 31928

I was wondering, would it be possible to use that jdk to compile in compatibility mode and target version 8 at the cost of not using any 11 specific features?

Ideally --release 8 javac flag shall work fine when compiling with JDK11 for Java 8.

I was wondering, would it be possible to use that jdk to compile in compatibility mode and target version 8 at the cost of not using any 11 specific features?

I would guess the bytecode generated after the compilation from the first step could be used consistently across 32-bit and 64-bit runtime systems(environments).

Upvotes: 6

Related Questions