adoptium / adoptium/containers

JDK_JAVA_OPTIONS picked up twice

Open
#153 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
289
Forks
129
Avg merge
1d 12h
Merged PRs (30d)
12

Description

When using the JDK_JAVA_OPTIONS environment variable it's picked up twice.

```bash
$ echo 'public class Test { public static void main(String[] args) { System.out.println("Should pick once"); } }' > Test.java
$ docker run --rm -it -v $(pwd)/Test.java:/Test.java:Z -e JDK_JAVA_OPTIONS="-Dsomehow=duplicated" eclipse-temurin:17.0.1_12-jdk-alpine java Test.java
NOTE: Picked up JDK_JAVA_OPTIONS: -Dsomehow=duplicated
NOTE: Picked up JDK_JAVA_OPTIONS: -Dsomehow=duplicated
Should pick once
```

Visible also by running an app in the background and doing

```bash
$ jps -lvm
6 jdk.compiler/com.sun.tools.javac.launcher.Main Test.java -Dsomehow=duplicated -Dsomehow=duplicated --add-modules=ALL-DEFAULT
```

Also visible from JMX.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the supplied docker run command and compare the two JDK_JAVA_OPTIONS notices and the jps output. Inspect how the Eclipse Temurin container starts Java and passes environment options; done means the option is picked up once and appears once in the running process and JMX view.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.