Created attachment 218659 [details]
use of the correct version of java for SH3D
When multiple versions of java are installed on the computer
javavmwrapper uses the latest one to launch SweetHome3d causing
a crash if the version is bigger than the version used to build
Find attached a patch to enforce the use of the correct
version of java by javavmwrapper based on the USE_JAVA
variable declared on the Makefile.
Funny, initially I couldn't reproduce it. I have both openjdk8 and openjdk11 installed, and javavm -version reports 1.8.0_262.
Today I decided to read the manpage and found this:
> This selection process is usually achieved through the use of
> /usr/ports/Mk/bsd.java.mk. However, if this is not present then javavm
> will use its own internal selection process which is designed to behave
> almost identically.
After I've renamed `bsd.java.mk' temporarily, it started to default to version 11, and I could reproduce the crash. Will commit the fix shortly.
Not exactly sure what to do about the selection process not behaving "almost identically", but per my definition of "almost", either the selection logic or the manpage should adjusted.
A commit references this bug:
Date: Fri Oct 23 08:23:23 UTC 2020
New revision: 553098
- Enforce JAVA_VERSION when launching javavm(1), otherwise the program
crashes when several JDK versions are installed and javawm(1) picks
higher version (happens when /usr/ports/Mk/bsd.java.mk is absent,
contrary to documented selection process which is designed to behave
almost identically WRT presence/absence of /usr/ports/Mk/bsd.java.mk
- While here, simplify the script a bit and remove keywords and their
expansion, they are useless for wrapper scripts
Submitted by: rodrigo
Should be fixed as of ports r553098, thank you.