Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make - build fail - Fail to detect correct java version #163

Open
Gaetanbrl opened this issue Dec 23, 2024 · 2 comments
Open

Make - build fail - Fail to detect correct java version #163

Gaetanbrl opened this issue Dec 23, 2024 · 2 comments

Comments

@Gaetanbrl
Copy link

Gaetanbrl commented Dec 23, 2024

OS : DEBIAN 12
JAVA : 11, 17, 21

Description

Hi,

I don't use JAVA_HOME but alternative tool because i need to swhitch between many java version (many project...).

I try to build the gateway without JAVA_HOME and get BUILD FAILURE with make command (see below).

Java 11 seems detected... but 21 is in use.

After set JAVA_HOME, it works fine.

it's annoying because maven detects the right version of java 21 and current java --version return expected version 21.

image

Error details

[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-and-java) @ georchestra-gateway ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 11.0.21 is not in the allowed range [21,).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:05 min
[INFO] Finished at: 2024-12-23T14:32:58+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce (enforce-maven-and-java) on project georchestra-gateway: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR] 
@Gaetanbrl
Copy link
Author

I see that the JAVA_HOME variable seems to be a prerequisite :

@REM JAVA_HOME - location of a JDK home dir

# JAVA_HOME - location of a JDK home dir

@Gaetanbrl
Copy link
Author

Gaetanbrl commented Dec 23, 2024

After check, maven-enforcer-plugin seems check JAVA_HOME value and FAIL if not correct.

<version>[${java.version},)</version>

But i don't understand why java 11 was returned instead of 21 -> Seems due to default maven java version

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

No branches or pull requests

1 participant