markhobson / docker-maven-chrome

Docker image for Java automated UI tests.
https://hub.docker.com/r/markhobson/maven-chrome/
Apache License 2.0
101 stars 82 forks source link

The JAVA_HOME environment variable is not defined correctly #40

Closed SebastianSchork closed 2 years ago

SebastianSchork commented 2 years ago

It seems that the newest release (we are using markhobson/maven-chrome:jdk-17) has a problem with the JAVA_HOME environment variable. E.g., calling mvn clean causes the following error log:

The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.

We have echoed the value of the JAVA_HOME env and it (correctly?) points to /opt/java/openjdk.

markhobson commented 2 years ago

Can you provide steps to reproduce? If I run mvn clean against the demo project then it succeeds for me:

docker run --rm -it -v $PWD/demo:/usr/src -w /usr/src markhobson/maven-chrome:jdk-17 mvn clean
SebastianSchork commented 2 years ago

Apologies for my late answer after you responded so quickly @markhobson. It turned out to be related to the fact that the image now depends on Ubuntu Jammy. Our infrastructure is not yet able to run it properly what caused Java to fail with an out of memory leading to a false-positive "The JAVA_HOME environment variable is not defined correctly(..)".

Long story short: problem identified, it is related to our infrastructure.

markhobson commented 2 years ago

@SebastianSchork No problem, glad you managed to resolve the issue!

kprasant commented 10 months ago

@markhobson same issue ... any resolution please let me know.

@jenkins-vm:~/test$ docker run -it markhobson/maven-chrome:latest
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
@jenkins-vm:~/test$ docker run -it markhobson/maven-chrome:latest sh
# mvn
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
# 

Running on linux, version below

@jenkins-vm:~/test$ uname -a
Linux jenkins-vm 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux
kprasant commented 10 months ago

Apologies for my late answer after you responded so quickly @markhobson. It turned out to be related to the fact that the image now depends on Ubuntu Jammy. Our infrastructure is not yet able to run it properly what caused Java to fail with an out of memory leading to a false-positive "The JAVA_HOME environment variable is not defined correctly(..)".

Long story short: problem identified, it is related to our infrastructure.

I am using ``` @jenkins-vm:~/test$ uname -a Linux jenkins-vm 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux


What was done to use this image?