JAVA_ Home is not defined correctly (only from Jenkins)
•
Java
Tried to set Jenkins, but my build failed:
$ant test Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java Build step 'Invoke Ant' marked build as failure
If I manually run "ant test" on the machine, it can run normally and Java_ Home is set to exactly the same value Do you know why Jenkins failed when he tried to run it? Are more environment variables involved (although I can't see it)?
Solution
For others, I must add path / usr / bin / to the path variable in Jenkins (find the correct path to which java to use)
Jenkins > Manage Jenkins > configure the system
Add environment variable > >
For example:
Name: path value: / usr / local / bin /: / usr / bin/
screenshot
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码