Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenJDK 18 - JAVAC Fails this check #5668

Open
3 tasks done
NathanaelA opened this issue May 11, 2022 · 2 comments
Open
3 tasks done

OpenJDK 18 - JAVAC Fails this check #5668

NathanaelA opened this issue May 11, 2022 · 2 comments

Comments

@NathanaelA
Copy link
Contributor

NathanaelA commented May 11, 2022

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

  1. Install Ubuntu 22.04,
  2. install OpenJDK 18,
  3. install NativeScript,
  4. 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

@NathanaelA NathanaelA added the bug-pending-triage Reported bug, pending triage to confirm. label May 11, 2022
@rigor789
Copy link
Member

We have improvements to the doctor setup in the pipeline, however do note that Java 18 is not officially supported by gradle:

A Java version between 8 and 17 is required to execute Gradle. Java 18 and later versions are not yet supported.

Source: https://docs.gradle.org/current/userguide/compatibility.html

@rigor789 rigor789 removed the bug-pending-triage Reported bug, pending triage to confirm. label May 12, 2022
@NathanaelA

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants