You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/27 10:03:43 UTC

[GitHub] [cordova-android] ldesroch opened a new issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

ldesroch opened a new issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221


   Cordova isn't detecting java 8 jdk when a more recent version is installed.
   Even when the JAVA_HOME env var is properly set :
   
   `
   PS C:\Users\loicm\workspace\prestas\bayard\cordova-poc\in-app-browser> cordova run android
   Checking Java JDK and Android SDK versions
   ANDROID_SDK_ROOT=C:\Users\loicm\AppData\Local\Android\Sdk\platforms\android-30 (recommended setting)
   ANDROID_HOME=C:\Users\loicm\AppData\Local\Android\Sdk (DEPRECATED)
   Requirements check failed for JDK 1.8.x! Detected version: 15.0.1
   Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
   PS C:\Users\loicm\workspace\prestas\bayard\cordova-poc\in-app-browser> $Env:ANDROID_SDK_ROOT
   C:\Users\loicm\AppData\Local\Android\Sdk\platforms\android-30
   PS C:\Users\loicm\workspace\prestas\bayard\cordova-poc\in-app-browser> $Env:JAVA_HOME
   C:\Program Files\Java\jdk1.8.0_291
   `
   
   Cordova version : 10.0.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] mcfarljw edited a comment on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
mcfarljw edited a comment on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834042419


   I don't know if it's related or not but a few days ago there was a big Android Studio update and that is when mine stopped working as well. Mine is spouting a different detected version as I was previously using whatever they provided.
   
   ```
   export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
   export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
   export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
   export PATH="$ANDROID_SDK_ROOT/tools/bin:$PATH"
   
   Requirements check failed for JDK 1.8.x! Detected version: 11.0.8
   ```
   
   @breautek tried downgrading to `cordova-android@9.0` and still having the same issue. My guess is that some auto updated with java recently, whether it be related to Android Studio or not, that is causing the issue.
   
   https://developer.android.com/studio/releases#4.2-bundled-jdk-11 seems to suggest this might be the case for me at least.
   
   https://developer.android.com/studio/releases#4.2-env-vars they have also deprecated `ANDROID_SDK_ROOT` if that is something that effects things or not.
   
   I ended up downgrading from Android Studio 4.2.0 to 4.1.3 and it's working again for me. Would it be possible to allow this version of the JDK given they have bumped their bundled version or is there something else that would block that?
   
   _For anyone who might be experiencing the same issue you can find previous versions of Android Studio here: https://developer.android.com/studio/archive_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] ldesroch commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
ldesroch commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-830666464


   9.1.0 I guess
   
   ```> cordova platform ls
   6.0.0
   Installed platforms:
     android 9.1.0
     browser
     ios 6.2.0
   Available platforms:
     browser ^6.0.0
     electron ^1.0.0
     windows ^7.0.0```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] maxlefou removed a comment on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
maxlefou removed a comment on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-976467263


   Having the same problem. I have two jre installed. the latest (17) and the 8 especially for that. But no matter how i set JAVA_HOME and force it on the path, it's ignored and only detects the jdk17. And I cannot just uninstall the 17 because I need it for other stuff.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] mcfarljw commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
mcfarljw commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834042419


   I don't know if it's related or not but a few days ago there was a big Android Studio update and that is when mine stopped working as well. Mine is spouting a different detected version as I was previously using whatever they provided.
   
   ```
   export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
   export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
   export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
   export PATH="$ANDROID_SDK_ROOT/tools/bin:$PATH"
   
   Requirements check failed for JDK 1.8.x! Detected version: 11.0.8
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] mcfarljw edited a comment on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
mcfarljw edited a comment on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834042419


   I don't know if it's related or not but a few days ago there was a big Android Studio update and that is when mine stopped working as well. Mine is spouting a different detected version as I was previously using whatever they provided.
   
   ```
   export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
   export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
   export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
   export PATH="$ANDROID_SDK_ROOT/tools/bin:$PATH"
   
   Requirements check failed for JDK 1.8.x! Detected version: 11.0.8
   ```
   
   @breautek tried downgrading to `cordova-android@9.0` and still having the same issue. My guess is that some auto updated with java recently, whether it be related to Android Studio or not, that is causing the issue.
   
   https://developer.android.com/studio/releases#4.2-bundled-jdk-11 seems to suggest this might be the case for me at least.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] mcfarljw edited a comment on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
mcfarljw edited a comment on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834042419


   I don't know if it's related or not but a few days ago there was a big Android Studio update and that is when mine stopped working as well. Mine is spouting a different detected version as I was previously using whatever they provided.
   
   ```
   export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
   export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
   export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
   export PATH="$ANDROID_SDK_ROOT/tools/bin:$PATH"
   
   Requirements check failed for JDK 1.8.x! Detected version: 11.0.8
   ```
   
   @breautek tried downgrading to `cordova-android@9.0` and still having the same issue. My guess is that some auto updated with java recently, whether it be related to Android Studio or not, that is causing the issue.
   
   https://developer.android.com/studio/releases#4.2-bundled-jdk-11 seems to suggest this might be the case for me at least.
   
   https://developer.android.com/studio/releases#4.2-env-vars they have also deprecated `ANDROID_SDK_ROOT` if that is something that effects things or not.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] breautek commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-830836539


   Thanks for your response,
   
   9.1 introduced some refactoring changes around java detection, can you confirm if you see the same behaviour on `cordova-android@9.0`?
   
   This will tell us if this was a new problem introduced as part of that refactoring, or if it's just simply an older problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] breautek commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-835597270


   I believe this is caused by having a Java path in your `PATH` variable, at least that's one way to reproduce it. PR will be coming shortly.
   
   As a workaround, ensure that the Java8 bin path comes before any other java installations. The incoming PR, if JAVA_HOME is specified, will ensure that your `JAVA_HOME` bath comes before anything else for the cordova execution context.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] breautek commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-830662612


   What's your `cordova-android` version? (`cordova platform ls`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] maxlefou commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
maxlefou commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-976467263


   Having the same problem. I have two jre installed. the latest (17) and the 8 especially for that. But no matter how i set JAVA_HOME and force it on the path, it's ignored and only detects the jdk17. And I cannot just uninstall the 17 because I need it for other stuff.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] breautek closed issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] mcfarljw edited a comment on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
mcfarljw edited a comment on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834042419


   I don't know if it's related or not but a few days ago there was a big Android Studio update and that is when mine stopped working as well. Mine is spouting a different detected version as I was previously using whatever they provided.
   
   ```
   export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
   export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
   export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
   export PATH="$ANDROID_SDK_ROOT/tools/bin:$PATH"
   
   Requirements check failed for JDK 1.8.x! Detected version: 11.0.8
   ```
   
   @breautek tried downgrading to `cordova-android@9.0` and still having the same issue. My guess is that some auto updated with java recently, whether it be related to Android Studio or not, that is causing the issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] breautek commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-834564279


   > I ended up downgrading from Android Studio 4.2.0 to 4.1.3 and it's working again for me. Would it be possible to allow this version of the JDK given they have bumped their bundled version or is there something else that would block that?
   
   It's tricky, because AS tooling 4.1 and lower doesn't work on Java > 8. AS tooling 4.2 as you experienced, requires at least Java 11 and will not work on Java 8.
   
   Good news is, we can probably upgrade to Java 11 now for the next major release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-android] ahalbrock commented on issue #1221: Cordova isn't detecting java 8 jdk when a more recent version is installed

Posted by GitBox <gi...@apache.org>.
ahalbrock commented on issue #1221:
URL: https://github.com/apache/cordova-android/issues/1221#issuecomment-1050066675


   Just adding some info.  I am running on Mac and was using /usr/libexec/java_home to set $JAVA_HOME env variable and specifying -v 1.8 as I also have Java 11 jdk installed but was running into this issue.  In the end I didn't realize I also had a Java 8 JRE installed and it was automatically choosing that, so not overwriting the javac to be the 1.8 version, causing the java version check issues.  After being more specific, -v 1.8.0_221, it properly copied over the 1.8 jdk stuff and now the project compiles.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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