-
Notifications
You must be signed in to change notification settings - Fork 140
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
The JAVA_HOME environment variable is not defined correctly, #358
Comments
@sharon-go from what I can read, the error comes from your docker image so that means that the variable is not defined correctly in the environment inside the container. The fact that it is defined in your machine is irrelevant... unless you pass it on, which I wouldn't recommend because probably the path specified in that variable wouldn't be the same. That said, assuming you are running the official and latest
I can duplicate the error if I replace the variable with another value:
So the issue appears to be that either your docker compose file or your plugin's configuration is replacing the variable as it comes in the image to an invalid value :( |
Hey, Look like an issue in docker-maven I did try to run the mvn command using your example same issue: docker run --rm -ti maven:latest /bin/sh -c 'env | sort | grep JAVA' |
@sharon-go glad to know that it is a compatibility issue between the latest maven images and old docker daemons and not something in this plugin :) |
Yes this is the issue :) Thank you . docker run --rm -ti maven:latest /bin/sh -c 'mvn --version' |
Hey,
On my local server echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
docker-compose.yml
version: "3"
services:
maven:
# Run pre-built maven image from docker library
image: maven
volumes:
# Cache maven dependencies
- $HOME/.m2:/root/.m2
# Mount the application source and target directories
- ..:/app
# Run maven inside the application directory
working_dir: /app
volumes:
maven-repository:
pipeline.yml
steps:
command: mvn clean install -P local
artifact_paths: "target/*.jar"
plugins:
run: maven
config: .buildkite/docker-compose.yml
when trying to build my java project getting this error:
docker-compose -f .buildkite/docker-compose.yml -p buildkite0184627a9f4e4fc4b0452a9bdce7c59b run --name buildkite0184627a9f4e4fc4b0452a9bdce7c59b_maven_build_49 --rm maven /bin/sh -e -c 'mvn clean install -P local'
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
user command error: The plugin docker-compose command hook exited with status 1
The text was updated successfully, but these errors were encountered: