#24090 closed defect (wontfix)
[PATCH] Improve java version detection in /usr/bin/josm
| Reported by: | ZLima12 | Owned by: | ZLima12 |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description
Previously, the first line of output from the java -version command was assumed to be the version string, but this is not guaranteed. For example, when the _JAVA_OPTIONS environment variable is not empty, a "Picked up _JAVA_OPTIONS" message is printed before the version string. When this happens, java_version produces an empty string, which later results in some java options not being passed to the JVM.
Attachments (1)
Change History (4)
by , 22 months ago
| Attachment: | java-version.patch added |
|---|
comment:1 by , 22 months ago
| Owner: | changed from to |
|---|---|
| Status: | new → needinfo |
comment:2 by , 5 weeks ago
| Resolution: | → wontfix |
|---|---|
| Status: | needinfo → closed |
comment:3 by , 4 weeks ago
A more portable patch could have not redirected stderr to stdout, thereby avoiding the Picked up _JAVA_OPTIONS being passed to head and awk. Or grep -v _JAVA_OPTIONS...
I've also seen this suggested:
_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS" unset _JAVA_OPTIONS alias java='java "$_SILENT_JAVA_OPTIONS"'



I do not think your patch works with other java distributions than openjdk or does it? For sure both tested and latest need to be fixed and your current patch only handles the former.
How do you install and start JOSM? Where do you set the environment options?