RFR: 8375458: Check legal folder of JDK image for unwanted files

Erik Joelsson erikj at openjdk.org
Tue Jan 20 19:26:56 UTC 2026


On Tue, 20 Jan 2026 16:53:55 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> test/jdk/build/CheckFiles.java line 164:
>> 
>>> 162:         requiredFilesInLegalSubdirs.add("ADDITIONAL_LICENSE_INFO");
>>> 163:         requiredFilesInLegalSubdirs.add("ASSEMBLY_EXCEPTION");
>>> 164:         requiredFilesInLegalSubdirs.add("LICENSE");
>> 
>> This set of files is expected for OpenJDK builds, but different vendors may be building the JDK under different license agreements and consequently, this set of files will differ. As an example, OracleJDK has the files `LICENSE` and `COPYRIGHT`.
>> 
>> I think we can check for the file `LICENSE`. If we are to check for the rest of the upper case files, it needs to be conditional on the LICENSE being GPL.
>
>> This set of files is expected for OpenJDK builds, but different vendors may be building the JDK under different license agreements and consequently, this set of files will differ. As an example, OracleJDK has the files `LICENSE` and `COPYRIGHT`.
>> 
>> I think we can check for the file `LICENSE`. If we are to check for the rest of the upper case files, it needs to be conditional on the LICENSE being GPL.
> 
> 
> Good point !  Can I easily check from the test what kind of license it is ? Or if it is OpenJDK or OracleJDK (or a licensee JDK) ?

I would suggest checking the LICENSE file as you find it. If the first line is the below, then it's a GPL licensed build.


The GNU General Public License (GPL)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29272#discussion_r2709767420


More information about the build-dev mailing list