epsilon icon indicating copy to clipboard operation
epsilon copied to clipboard

Investigate raising the source level to Java 17

Open agarciadom opened this issue 1 year ago • 1 comments

We should try to increase the source level of the codebase to Java 17, to gain access to features like var, text blocks, and other Java 11+ niceties. This must not impact the target level, to avoid affecting users.

agarciadom avatar May 30 '24 14:05 agarciadom

I just got bit by trying to set a source level of 17 and a target level of 11 in a maven project. It seems the compiler would not handle that for you (as one would expect given the option to set source and target individually), resulting in the error source release 17 requires target release 17.

JEP 247 elaborates on this, basically recommending to use release instead of source and target. The release option adds a "documented APIs" parameter when used with "modern" java versions (>=9) and sets source and target to the same value. I wonder if by setting the correct value of this extra parameter a correct backwards compilation could be achieved.

alfonsodelavega avatar Jun 17 '24 15:06 alfonsodelavega