Issue Description
ns doctor or ns build android will fail on later versions of OpenJDK installations (basically failing to detect that it is installed, because the version check fails to get a number version). Giving you an error message about javac not installed or JAVA_HOME not being set.
This line has the failing regex.
|
private static JAVA_COMPILER_VERSION_REGEXP = /^javac (.*)/im; |
Replaced in my local copy with:
SysInfo.JAVA_COMPILER_VERSION_REGEXP = /^javac (\d*)/im;
Changed the (.*) to (\d*) meaning grab all numbers...
Reproduction
- Install Ubuntu 22.04,
- install OpenJDK 18,
- install NativeScript,
- run
NS doctor
Relevant log output (if applicable)
No response
Environment
echo $JAVA_HOME -> /usr/lib/jvm/java-18-openjdk-amd64
javac -version -> javac 18-ea
OS: Linux 5.17 Pop!_OS 22.04 LTS
Shell: /bin/bash
node: 16.15.0
npm: 8.5.5
nativescript: 8.2.3
android
java: javac 18-ea
ndk: Not Found
apis: 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
build_tools: 30.0.0, 30.0.3, 33.0.0, 33.0.0
Please accept these terms
Issue Description
ns doctororns build androidwill fail on later versions of OpenJDK installations (basically failing to detect that it is installed, because the version check fails to get a number version). Giving you an error message about javac not installed orJAVA_HOMEnot being set.This line has the failing regex.
nativescript-cli/packages/doctor/src/sys-info.ts
Line 15 in e44ca94
Replaced in my local copy with:
SysInfo.JAVA_COMPILER_VERSION_REGEXP = /^javac (\d*)/im;Changed the
(.*)to(\d*)meaning grab all numbers...Reproduction
NS doctorRelevant log output (if applicable)
No response
Environment
echo $JAVA_HOME ->
/usr/lib/jvm/java-18-openjdk-amd64javac -version ->
javac 18-eaOS: Linux 5.17 Pop!_OS 22.04 LTS
Shell: /bin/bash
node: 16.15.0
npm: 8.5.5
nativescript: 8.2.3
android
java: javac 18-ea
ndk: Not Found
apis: 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
build_tools: 30.0.0, 30.0.3, 33.0.0, 33.0.0
Please accept these terms