If the user has set LD_LIBRARY_PATH to use a particular libjvm.so, options from the JDK_JAVA_OPTIONS environment variable are picked up twice.
If an option cannot be accepted twice (e.g., -agentlib), the application fails to start. The same happens on operating systems that doesn't support $RPATH/$ORIGIN and always have to set LD_LIBRARY_PATH and re-exec the launcher. The fix adds one additional argument - orig_argv to JLI_Launch() and use it in on relaunch in execv() call. All relevant jtreg tests are passed. ------------- Commit messages: - 8293806: JDK_JAVA_OPTIONS picked up twice if LD_LIBRARY_PATH is set Changes: https://git.openjdk.org/jdk/pull/10420/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10420&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8293806 Stats: 35 lines in 8 files changed: 11 ins; 12 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/10420.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10420/head:pull/10420 PR: https://git.openjdk.org/jdk/pull/10420