You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Andreas Kohn (JIRA)" <ji...@apache.org> on 2016/05/31 15:44:12 UTC

[jira] [Updated] (CB-11343) Handle Java 9 after JEP 223

     [ https://issues.apache.org/jira/browse/CB-11343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Kohn updated CB-11343:
------------------------------
    Description: 
`cordova requirements android` fails on a system with Java 9(-ea) installed and accessible via PATH/JAVA_HOME:

{code}
$ cordova requirements android

Requirements check results for android:
Java JDK: not installed 
Cannot read property '1' of null
Android SDK: installed 
Android target: installed android-17,android-18,android-19,android-21,android-22,android-23,android-N
Gradle: installed 
Error: Some of requirements check failed
$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andreas/.local/bin:/home/andreas/bin:/usr/java/jdk-9/bin:/home/andreas/modules/apache-maven/bin:/home/andreas/modules/apache-ant/bin:/home/andreas/modules/mongodb/bin:/home/andreas/modules/node/bin:/home/andreas/modules/android-sdk-linux/tools:/home/andreas/modules/android-sdk-linux/platform-tools
$ which javac
/usr/java/jdk-9/bin/javac
$ echo $JAVA_HOME
/usr/java/jdk-9
$ javac -version
javac 9-ea
$ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+120)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+120, mixed mode)
{code}

The exception is caused by the regular expression magic in check_reqs.js, `check_java` function:
{code}
var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
{code}
(5.2.0-dev is slightly different, but has the same issue).

I think the easiest fix here is to change the expression to this:
{code}
var match = /javac ((?:\d+\.)*(?:\d+))/i.exec(output)[1];
{code}


  was:
`cordova requirements android` fails on a system with Java 9(-ea) installed and accessible via PATH/JAVA_HOME:

~~~~
$ cordova requirements android

Requirements check results for android:
Java JDK: not installed 
Cannot read property '1' of null
Android SDK: installed 
Android target: installed android-17,android-18,android-19,android-21,android-22,android-23,android-N
Gradle: installed 
Error: Some of requirements check failed
$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andreas/.local/bin:/home/andreas/bin:/usr/java/jdk-9/bin:/home/andreas/modules/apache-maven/bin:/home/andreas/modules/apache-ant/bin:/home/andreas/modules/mongodb/bin:/home/andreas/modules/node/bin:/home/andreas/modules/android-sdk-linux/tools:/home/andreas/modules/android-sdk-linux/platform-tools
$ which javac
/usr/java/jdk-9/bin/javac
$ echo $JAVA_HOME
/usr/java/jdk-9
$ javac -version
javac 9-ea
$ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+120)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+120, mixed mode)
~~~~

The exception is caused by the regular expression magic in check_reqs.js, `check_java` function:
~~~~
var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
~~~~
(5.2.0-dev is slightly different, but has the same issue).

I think the easiest fix here is to change the expression to this:
~~~~
var match = /javac ((?:\d+\.)*(?:\d+))/i.exec(output)[1];
~~~~



> Handle Java 9 after JEP 223
> ---------------------------
>
>                 Key: CB-11343
>                 URL: https://issues.apache.org/jira/browse/CB-11343
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>    Affects Versions: 5.1.1
>            Reporter: Andreas Kohn
>
> `cordova requirements android` fails on a system with Java 9(-ea) installed and accessible via PATH/JAVA_HOME:
> {code}
> $ cordova requirements android
> Requirements check results for android:
> Java JDK: not installed 
> Cannot read property '1' of null
> Android SDK: installed 
> Android target: installed android-17,android-18,android-19,android-21,android-22,android-23,android-N
> Gradle: installed 
> Error: Some of requirements check failed
> $ echo $PATH
> /usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andreas/.local/bin:/home/andreas/bin:/usr/java/jdk-9/bin:/home/andreas/modules/apache-maven/bin:/home/andreas/modules/apache-ant/bin:/home/andreas/modules/mongodb/bin:/home/andreas/modules/node/bin:/home/andreas/modules/android-sdk-linux/tools:/home/andreas/modules/android-sdk-linux/platform-tools
> $ which javac
> /usr/java/jdk-9/bin/javac
> $ echo $JAVA_HOME
> /usr/java/jdk-9
> $ javac -version
> javac 9-ea
> $ java -version
> java version "9-ea"
> Java(TM) SE Runtime Environment (build 9-ea+120)
> Java HotSpot(TM) 64-Bit Server VM (build 9-ea+120, mixed mode)
> {code}
> The exception is caused by the regular expression magic in check_reqs.js, `check_java` function:
> {code}
> var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
> {code}
> (5.2.0-dev is slightly different, but has the same issue).
> I think the easiest fix here is to change the expression to this:
> {code}
> var match = /javac ((?:\d+\.)*(?:\d+))/i.exec(output)[1];
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org