﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
20920	JEP 247: Compile for Older Platform Versions (javac --release 8)	simon04	simon04	"Currently, we compile JOSM using `javac -source 1.8 -target 1.8` causing the following warning when using a newer JDK:

{{{
warning: [options] bootstrap class path not set in conjunction with -source 8
}}}

Starting with Java 9, `javac --release 8` may be used: ""Compiles against the public, supported and documented API for a specific VM version"" thanks to [https://openjdk.java.net/jeps/247 JEP 247: Compile for Older Platform Versions]

> JEP 247 – Motivation
> javac provides two command line options, -source and -target, which can be used to select the version of the Java language accepted by the compiler and the version of the class files it produces, respectively. By default, however, javac compiles against the most-recent version of the platform APIs. The compiled program can therefore accidentally use APIs only available in the current version of the platform. Such programs cannot run on older versions of the platform, regardless of the values passed to the -source and -target options. This is a long-term usability pain point, since users expect that by using these options they'll get class files that can run on the the platform version specified by -target.

[https://ant.apache.org/manual/Tasks/javac.html Ant's <javac>] supports `release`:
> Specify the value for the --release switch.
> When set and running on JDK 9+ the source and target attributes as well as the bootclasspath will be ignored. Since Ant 1.9.8.
> Required: No, ignored when compiling on JDK 8 or earlier

{{{
[javac] Support for javac --release has been added in Java9 ignoring it
}}}

Interesting insights: [https://www.morling.dev/blog/the-anatomy-of-ct-sym-how-javac-ensures-backwards-compatibility/ The Anatomy of ct.sym — How javac Ensures Backwards Compatibility - Gunnar Morling]"	enhancement	closed	normal	21.05	Core		fixed	javac	
