NativeScript / NativeScript/nativescript-cli
OpenJDK 18 - JAVAC Fails this check
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 204
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
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.
https://github.com/NativeScript/nativescript-cli/blob/e44ca94cce733be5925988d07a8f99e0acc692c9/packages/doctor/src/sys-info.ts#L15
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
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in packages/doctor/src/sys-info.ts bei dem fehlschlagenden regulären Ausdruck für die Java-Compiler-Version. Reproduziere das Problem mit OpenJDK 18, indem du ns doctor oder ns build android ausführst, und überprüfe anschließend, dass javac 18-ea erkannt wird, statt als nicht vorhanden gemeldet zu werden. Das Issue ist abgeschlossen, wenn die Versionsprüfung für diese Ausgabe funktioniert, ohne die bestehende Java-Erkennung zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, typescript
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100