-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Unable to detect openjdk java verion. #6081
Comments
Hello @Magicloud, thanks for your report!
and then submit the following job: job "example" {
datacenters = ["dc1"]
type = "service"
constraint {
attribute = "${driver.java.version}"
operator = ">="
value = "11.0.0"
}
group "example" {
task "example" {
driver = "java"
config {
jar_path = "local/hello.jar"
jvm_options = ["-Xmx2048m", "-Xms256m"]
}
}
}
} which returned the following:
when I do
It looks like this version of the JDK doesn’t include |
Yes, my bad. I pasted java version strings from wrong term. The CentOS one is like yours, no quotes. |
I have a similar issue to this - java driver is not detecting for the following:
Client in the UI shows java detected: No. Is there any debug logging i can enable to help diagnose? Update: NVM, verbose node status shows my issue is that i'm not running nomad as root. |
This PR improves the regular expression used for matching the java version string, which varies a lot depending on the java vendor and version. These are the example strings we now test for: java version "1.7.0_80" openjdk version "11.0.1" 2018-10-16 openjdk version "11.0.1" 2018-10-16 java version "1.6.0_36" openjdk version "1.8.0_192" openjdk 11.0.11 2021-04-20 LTS The last one is a new test added on behalf of #6081, which is still broken on today's CentOS 7 default JDK package. openjdk 11.0.11 2021-04-20 LTS OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing) ==> Evaluation "21c6caf7" finished with status "complete" but failed to place all allocations: Task Group "example" (failed to place 1 allocation): * Constraint "${driver.java.version} >= 11.0.0": 1 nodes excluded by filter Evaluation "2b737d48" waiting for additional capacity to place remainder Fixes #6081
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
v0.9.4
Operating system and Environment details
CentOS 7
Issue
I cannot use
driver.java.version
constraint since it cannot get valid nodes.Reproduction steps
Use following driver and contraint.
Without the contraint (comment the whole object), task running fine. With the contraint, I got
While java version is:
The text was updated successfully, but these errors were encountered: