Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

A utility to perform a best effort selection of the Java version needed by the build tool to build a Java project.

License

Notifications You must be signed in to change notification settings

moderneinc/guess-my-java-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Guess My Java Version

A utility to perform a best effort selection of the Java version needed by the build tool to build a Java project. Moderne offers a large public dataset of type attributed abstract syntax trees (ASTs) produced from OSS code. These ASTs are built daily. In order to produce an AST, the Java version that the project's build tool must run with must be known in advance.

Unfortunately, neither Gradle or Maven require any explicit signal about the Java version they require, so this must be inferred from the project using a variety of heuristics.

Known heuristics

Heuristic Notes
Gradle sourceCompatibility See Java Plugin reference
Maven maven.compiler.source See blog
Use of libraries requiring a minimum Java 11 version Caffeine 3.+. This would likely involve looking for direct dependencies, since otherwise chicken and egg problem.
References to base docker images e.g. openjdk:11-jdk-slim
CircleCI Java version See openjdk. Also check docs for what implied default version is
TravisCI Java version See Building a Java project
GitHub actions Java version See GitHub actions docs
Any reference to Jigsaw The presence of a module-info.java or a declared dependency on a module
References to JakartaEE ??
sdkman config See this example
jenv config .java-version

About

A utility to perform a best effort selection of the Java version needed by the build tool to build a Java project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published