[JAVA-2992] Improve the warning message when building with Java version < 9 Created: 26/Sep/18  Updated: 28/Oct/23  Resolved: 16/Nov/18

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.11.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It's confusing that we print "1.8" and "1.9" in the build warning now that the releases are referred to as "8" and "9".

Consider changing the warning to:

        gradle.rootProject.logger.error("\nWARNING:\nJava ${JavaVersion.VERSION_1_9.getMajorVersion()} is required to build the driver: " +
                "you are using Java ${JavaVersion.current().getMajorVersion()}.")

Which will print:

Java 9 is required to build the driver: you are using Java 8.



 Comments   
Comment by Githook User [ 16/Nov/18 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Use major JDK version number in Gradle error message

Now if you use JDK 8 to build the driver, it prints this error:

ERROR:
JDK 9 is required to build the driver: You are using JDK 8.

JAVA-2992
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a0766d21202d09b193fdb46685026bc42b6735ca

Generated at Thu Feb 08 08:58:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.