JEP 182: Policy for Retiring javac -source and -target OptionsJEP 182: Policy for Retiring javac -source and -target OptionsAuthorJoseph D. DarcyOwnerJoe DarcyTypeInformationalScopeJDKStatusDraftComponenttools / javacDiscussiondiscuss at openjdk dot java dot netReviewed byBrian GoetzEndorsed byBrian GoetzCreated2013/04/02 20:00Updated2023/06/09 20:20Issue8046172Summary
To reduce the maintenance costs of javac, this JEP defines a policy for
retiring old -source and -target options. In JDK 8, use of a source
or target of 1.5 or earlier will be deprecated and in JDK 9, support
for a source or target of 1.5 or earlier will be removed. In JDK 9 and
going forward, javac will use a "one + three back" policy of supported
source and target options. Under this policy, javac will still be able
to recognize and process class files of all previous JDKs, going back to
version 45.3 class files generated by JDK 1.0.2, which first shipped
in 1996.
Goals
Reduce compiler maintenance costs by removing obsolete code.
Motivation
By removing old source and target options, maintenance of the javac
compiler is simplified. Many of the source and target values supported in
JDK 8 are for release trains that have long passed their end of public
updates. Users of those releases can use the javac from those releases
if a recompile is necessary in the future.
The source and target options are not mandated by the Java SE
specification and are provided for programmer convenience. However,
maintenance of old options has nonzero cost. For example, when a -source N option older than the source level of rt.jar is specified, it is not
clear how newer-than-release-N language artifacts in the platform
libraries should be modeled to the code being compiled. Reducing the span
of supported source and target values simplifies the design
considerations of such questions.
Description
The never-documented target options jsr14, 1.4.1 and 1.4.2 have
already been removed from JDK 8. Source and target values of 1.5/5 and
earlier will be deprecated in JDK 8. A warning will be printed when such
options are used. In JDK 9, those options will no longer be recognized by
javac. JDK 9 will implement a "one plus three back" support policy
meaning that 1.9/9, 1.8/8, 1.7/7, and 1.6/6 will be
recognized in that release. That policy will continue in JDK 10.
Impact

Compatibility: This policy changes the command-line compatibility
policy, but even with this new policy source code 10 or more years
old should still be able to be compiled.

InstallingContributingSponsoringDevelopers' GuideVulnerabilitiesJDK GA/EA BuildsMailing listsWiki
                      · IRCBylaws · CensusLegalWorkshopJEP ProcessSource codeMercurialGitHubToolsGitjtreg harnessGroups(overview)AdoptionBuildClient LibrariesCompatibility & Specification ReviewCompilerConformanceCore LibrariesGoverning BoardHotSpotIDE Tooling & SupportInternationalizationJMXMembersNetworkingPortersQualitySecurityServiceabilityVulnerabilityWebProjects(overview,
      archive)AmberBabylonCRaCCaciocavalloClosuresCode ToolsCoinCommon VM InterfaceCompiler GrammarDetroitDevelopers' GuideDevice I/ODukeGalahadGraalIcedTeaJDK 7JDK 8JDK 8 UpdatesJDK 9JDK
      (…,
       21,
       22,
       23)JDK UpdatesJavaDoc.NextJigsawKonaKullaLambdaLanaiLeydenLilliputLocale EnhancementLoomMemory Model UpdateMetropolisMission ControlMulti-Language VMNashornNew I/OOpenJFXPanamaPenrosePort: AArch32Port: AArch64Port: BSDPort: HaikuPort: Mac OS XPort: MIPSPort: MobilePort: PowerPC/AIXPort: RISC-VPort: s390xPortolaSCTPShenandoahSkaraSumatraTiered AttributionTsanType AnnotationsValhallaVeronaVisualVMWakefieldZeroZGC

        © 2024 Oracle Corporation and/or its affiliates
        Terms of Use
        ·
        
            License: GPLv2
        · Privacy
        · Trademarks
