breautek commented on issue #845:
URL: https://github.com/apache/cordova-android/issues/845#issuecomment-686578633


   > Not sure how I reply to my previous post?
   > To be clear "Can we set the jdk in a config file or in the CLI to tell 
Cordova where the JDK8 is? - this is not possible currently?
   
   Short answer: There is no configuration variable that you can set to tell 
just cordova to use a specific JDK installation.
   
   Long answer:
   But Cordova will read the `JAVA_HOME` variable, but obviously many other 
systems installed on your machine will also use this variable.
   
   There are potentially some workarounds to make only Cordova use a specific 
JDK installation... such as providing the system variable inline with the 
cordova command:
   
   `JAVA_HOME=/path/to/jdk cordova build android`
   
   I haven't tested this, but you may need to override the `PATH` variable as 
well... e.g:
   
   `JAVA_HOME="/path/to/jdk" PATH="/path/to/jdk/bin/:$PATH" cordova build 
android`
   
   Obviously this isn't ideal to type out every single time, but it could be 
incorporated into a build script.
   
   I personally would support a `CORDOVA_JDK` variable that one can set and 
then not have to worry about, but I don't know if other PMC members will agree 
to this.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to