Modify ↓

Opened 22 months ago

Closed 5 weeks ago

Last modified 4 weeks ago

#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)

java-version.patch​ (500 bytes ) - added by ZLima12 22 months ago.

Download all attachments as: .zip

Change History (4)

by ZLima12, 22 months ago

Attachment: java-version.patch​ added

comment:1 by skyper, 22 months ago

Owner: changed from team to ZLima12
Status: new → needinfo

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?

comment:2 by gaben, 5 weeks ago

Resolution: → wontfix
Status: needinfo → closed

comment:3 by wangi, 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"'
Last edited 4 weeks ago by wangi (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ZLima12.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.