You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/18 07:50:21 UTC

[GitHub] [cordova] codenfast opened a new issue #284: Can We Work with Multiple JDK Version?

codenfast opened a new issue #284:
URL: https://github.com/apache/cordova/issues/284


   # Feature Request
   
   ## Motivation Behind Feature
   **JDK 8 is going too old**, can we upgrade it to JDK 11?
   Currently there is no path giving to a specified JDK location. So cordova's mandatory JDK-8 is when i work with mobile change to system enviroment ...etc. We need a set JDK location by run cordova. 
   
   ## Feature Description
   Normally we are run cordova with (example);
   `cordova run android`
   But cordova says;
   `Requirements check failed for JDK 8 ('1.8.*')! Detected version: 11
   Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.`
   if we can run with a specified JDK location, like;
   `cordova run android -jdk C:/oldJava/jdk8/bin`
   We can use multiple JDK versions will be more useful for cli commands
   
   
   ## Alternatives or Workarounds
   There is no alternative. I was searched (google, stackoverflow and documents).
   
   
   


-- 
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] raphinesse commented on issue #284: Can We Work with Multiple JDK Version?

Posted by GitBox <gi...@apache.org>.
raphinesse commented on issue #284:
URL: https://github.com/apache/cordova/issues/284#issuecomment-821971872


   I think it's safe to say that everyone in the Cordova team would be happy if we could stop having to require JDK 8. We always have inherited this requirement from the Android tooling. While it seems that it might finally be possible to use a newer JDK with Android tooling, there's a lot to watch out for with your setup and there would still be changes to be made to cordova-android. We probably will get there eventually, but it is just not a top priority right now.
   
   I do not think we want to introduce a command line option to set the JDK. There is a simple workaround: setting `JAVA_HOME` and `PATH` environment variables. In POSIX shells (e.g. Git Bash) this could look like this:
   
   ```
   export JAVA_HOME=C:/oldJava/jdk8
   export PATH=$JAVA_HOME/bin:$PATH
   ```
   
   In Windows `cmd` (untested):
   ```
   set JAVA_HOME=C:/oldJava/jdk8
   set PATH=%JAVA_HOME%/bin;%PATH%
   ```
   
   After that, all commands in this shell session will use the updated environment variables. So you can just use `cordova run android`. You can also change environment variables per command. The complexity of that varies depending on your shell.
   
   On Unix-like operating system (macOS, Linux, …) you can nicely automate this process using [direnv](https://direnv.net/). I just put above commands inside a `.envrc` file in the projects that use `cordova-android` and `direnv` applies the changes to the environment variables whenever I change into that directory.
   
   Of course you can also write a little helper script named `usejdk8` that does changes the environment.


-- 
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] raphinesse edited a comment on issue #284: Can We Work with Multiple JDK Version?

Posted by GitBox <gi...@apache.org>.
raphinesse edited a comment on issue #284:
URL: https://github.com/apache/cordova/issues/284#issuecomment-821971872


   I think it's safe to say that everyone in the Cordova team would be happy if we could stop having to require JDK 8. We always have inherited this requirement from the Android tooling. While it seems that it might finally be possible to use a newer JDK with Android tooling, there's a lot to watch out for with your setup and there would still be changes to be made to cordova-android. We probably will get there eventually, but it is just not a top priority right now.
   
   I do not think we want to introduce a command line option to set the JDK. There is a simple workaround: setting `JAVA_HOME` and `PATH` environment variables. In POSIX shells (e.g. Git Bash) this could look like this:
   
   ```
   export JAVA_HOME=C:/oldJava/jdk8
   export PATH=$JAVA_HOME/bin:$PATH
   ```
   
   In Windows `cmd` (untested):
   ```
   set JAVA_HOME=C:/oldJava/jdk8
   set PATH=%JAVA_HOME%/bin;%PATH%
   ```
   
   After that, all commands in this shell session will use the updated environment variables. So you can just use `cordova run android`. You can also change environment variables per command. The complexity of that varies depending on your shell.
   
   On Unix-like operating system (macOS, Linux, …) you can nicely automate this process using [direnv](https://direnv.net/). I just put above commands inside a `.envrc` file in the projects that use `cordova-android` and `direnv` applies the changes to the environment variables whenever I change into that directory.
   
   Of course you can also write a little helper script named `usejdk8` that changes the environment.


-- 
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] raphinesse closed issue #284: Can We Work with Multiple JDK Version?

Posted by GitBox <gi...@apache.org>.
raphinesse closed issue #284:
URL: https://github.com/apache/cordova/issues/284


   


-- 
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova] breautek commented on issue #284: Can We Work with Multiple JDK Version?

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


   Just wanted to note that current AS alpha preview uses java 11, so soon.... we will be able to upgrade to java 11. But i don't think it will happen in our next major cordova-android@10


-- 
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org