Skip to content

Remove JDK 6 & 7 development dependencies using JDK 9's new javac '--release' flag#125

Merged
jstuyts merged 2 commits intoargparse4j:masterfrom
concision:feat/reduce-jdk-dependencies
Oct 6, 2020
Merged

Remove JDK 6 & 7 development dependencies using JDK 9's new javac '--release' flag#125
jstuyts merged 2 commits intoargparse4j:masterfrom
concision:feat/reduce-jdk-dependencies

Conversation

@concision
Copy link
Copy Markdown
Contributor

As a continuation of some of the discussion over at #123, this pull request removes the dependency on JDK6 & 7 installations to successfully compile the project with Maven.

Previously, JDK 6/7 were needed for their rt.jar in bootclasspath to ensure that no new classes/methods/fields/code above the target language level were accidentally introduced during development, causing potential runtime errors for library users. With the successful merge of #124, JDK 9+ is now required for project compilation, which enables support for javac's --release flag that implements the same functionality without any dependency on JDK 6/7. This feature was not possible in the previous required JDK 8.

Impacts:

  • Appears to consistently shave off roughly ~8 seconds from fetching JDK 6 during CI builds, observed from the build times in prior Travis CI builds.
  • Requires a single JDK toolchain to compile this project, rather than 3 separate (and explicitly configured) JDKs. Although there has not been a much recent pull request traffic, this should improve the workflow for developers making future pull requests. Notably, it took me a non-negligible amount of time to realize I needed JDK 6 & 7 to author Experimental JDK9 module-info support #124, as rt.jar was removed from JDK 9 and this caused builds to immediately fail with the default properties.

@jstuyts
Copy link
Copy Markdown
Collaborator

jstuyts commented Oct 6, 2020

I really don't like that IntelliJ IDEA sets the language level of the Maven modules to Java 9. I have tried to make it so that the correct language level is used, even if that meant that editing for module-info.java was broken. But due to limitations of Maven and IntelliJ, I good not get it to work.

This means that you can use newer language features in the modules, and IntelliJ may even show suggestions for them. These errors will only be caught during a Maven build.

I still think this is an improvement, so I will merge it. Maybe an MRJAR with Maven or moving to Gradle will restore the correct language levels for all of the source sets.

@jstuyts jstuyts merged commit 0f7df2c into argparse4j:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants