when I try to build an app for android by phonegap cli, I have an error.
I want to specify I use ubuntu server, and the command is this:
root@s-lavorativo:/srv/applicazioni/ddns# phonegap -d build android
[phonegap] executing 'cordova -d build android ' ...
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /srv/applicazioni/ddns/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "Casa DDNS" to /srv/applicazioni/ddns/platforms/android/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000
Wrote out Android package name "qui.ddns.mio" to /srv/applicazioni/ddns/platforms/android/src/qui/ddns/mio/MainActivity.java
Updating icons at res
Updating splash screens at res
Prepared android project successfully
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
No scripts found for hook "before_compile".
Error: CordovaError: Requirements check failed for JDK 1.8 or greater
at _fulfilled (/srv/applicazioni/ddns/platforms/android/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/srv/applicazioni/ddns/platforms/android/cordova/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/srv/applicazioni/ddns/platforms/android/cordova/node_modules/q/q.js:796:13)
at runSingle (/srv/applicazioni/ddns/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (/srv/applicazioni/ddns/platforms/android/cordova/node_modules/q/q.js:125:13)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
I downloaded the android sdk and installed java dk, I also set up the environment variables, but I can't fix this.
How can I do? Help