You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "John M. Wargo (JIRA)" <ji...@apache.org> on 2018/03/15 01:36:00 UTC

[jira] [Updated] (CB-13972) Requirements check failed for JDK 1.8 or greater

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

John M. Wargo updated CB-13972:
-------------------------------

OK, so the problem is in `platforms\android\cordova\lib\check_reqs.js`:385:19, the check for Java is incomplete.  Right now, the code checks to see if Java_Home is set and if it can find javac.exe on the path. For my system, both are true, and the code is missing an action when both hasJavaHome is true and javacPath points to a valid javac.exe. 

```
if (hasJavaHome) {
   // Windows java installer doesn't add javac to PATH, nor set JAVA_HOME (ugh).
   if (!javacPath) {
     process.env['PATH'] +=path.delimiter+path.join(process.env['JAVA_HOME'], 'bin');
   }
} else {
```
Is it supposed to return the path?  I can't tall and, of course, there's no comments to tell me. Should it be something like this:
 
```
if (hasJavaHome) {
// Windows java installer doesn't add javac to PATH, nor set JAVA_HOME (ugh).
if (!javacPath) {
process.env['PATH'] +=path.delimiter+path.join(process.env['JAVA_HOME'], 'bin');
} else {
returnjavacPath;
}
} else {
```

> Requirements check failed for JDK 1.8 or greater
> ------------------------------------------------
>
>                 Key: CB-13972
>                 URL: https://issues.apache.org/jira/browse/CB-13972
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-cli
>    Affects Versions: cordova-android-7.0.0
>         Environment: Windows 10 64 (10.0.16229.248)
>            Reporter: John M. Wargo
>            Priority: Minor
>
> I've got a problem with my Java config, but the CLI reports the error then reports that it's deployed the app (when it hasn't).
> {{JAVA_HOME=D:\Program Files\Java\jdk-9.0.1}}
> {{(node:10316) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater}}
> {{ at D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\lib\check_reqs.js:370:19}}
> {{ at _fulfilled (D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:854:54)}}
> {{ at self.promiseDispatch.done (D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:883:30)}}
> {{ at Promise.promise.promiseDispatch (D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:816:13)}}
> {{ at D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:624:44}}
> {{ at runSingle (D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:137:13)}}
> {{ at flush (D:\dev\hardware\particle\particle-garage-controller-ionic\platforms\android\cordova\node_modules\q\q.js:125:13)}}
> {{ at _combinedTickCallback (internal/process/next_tick.js:131:7)}}
> {{ at process._tickCallback (internal/process/next_tick.js:180:9)}}
> {{(node:10316) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)}}
> {{(node:10316) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.}}
> {{[18:26:17] lint finished in 2.66 s}}{{[OK] Your app has been deployed.}}
> {{ Did you know you can live-reload changes from your app with --livereload?}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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