ERROR: JAVA_HOME is set to an invalid directory

hi guys i have an error with meteor run android-device take a look at this error log:
i checked the log and it seem to be module problem and JAVA path so how to solve it ? please :slight_smile:

Getting installed version for platform android in Cordova project
Checking Cordova requirements for platform Android
[[[[[ ~/Documents/dev/sampleTest ]]]]]

=> Started proxy.
=> Started MongoDB.
Local package version is up-to-date: allow-deny@1.0.5
Local package version is up-to-date: autopublish@1.0.7
Local package version is up-to-date: autoupdate@1.2.11
Local package version is up-to-date: babel-compiler@6.8.4
Local package version is up-to-date: babel-runtime@0.1.9_1
Local package version is up-to-date: base64@1.0.9
Local package version is up-to-date: binary-heap@1.0.9
Local package version is up-to-date: blaze@2.1.8
Local package version is up-to-date: blaze-html-templates@1.0.4
Local package version is up-to-date: blaze-tools@1.0.9
Local package version is up-to-date: boilerplate-generator@1.0.9
Local package version is up-to-date: caching-compiler@1.0.6
Local package version is up-to-date: caching-html-compiler@1.0.6
Local package version is up-to-date: callback-hook@1.0.9
Local package version is up-to-date: check@1.2.3
Local package version is up-to-date: ddp@1.2.5
Local package version is up-to-date: ddp-client@1.2.9
Local package version is up-to-date: ddp-common@1.2.6
Local package version is up-to-date: ddp-server@1.2.9
Local package version is up-to-date: deps@1.0.12
Local package version is up-to-date: diff-sequence@1.0.6
Local package version is up-to-date: ecmascript@0.4.7
Local package version is up-to-date: ecmascript-runtime@0.2.12
Local package version is up-to-date: ejson@1.0.12
Local package version is up-to-date: es5-shim@4.5.13
Local package version is up-to-date: fastclick@1.0.12
Local package version is up-to-date: geojson-utils@1.0.9
Local package version is up-to-date: hot-code-push@1.0.4
Local package version is up-to-date: html-tools@1.0.10
Local package version is up-to-date: htmljs@1.0.10
Local package version is up-to-date: http@1.1.8
Local package version is up-to-date: id-map@1.0.8
Local package version is up-to-date: insecure@1.0.7
Local package version is up-to-date: jquery@1.11.9
Local package version is up-to-date: launch-screen@1.0.12
Local package version is up-to-date: livedata@1.0.18
Local package version is up-to-date: logging@1.0.14
Local package version is up-to-date: meteor@1.1.16
Local package version is up-to-date: meteor-base@1.0.4
Local package version is up-to-date: minifier-css@1.1.13
Local package version is up-to-date: minifier-js@1.1.13
Local package version is up-to-date: minimongo@1.0.17
Local package version is up-to-date: mobile-experience@1.0.4
Local package version is up-to-date: mobile-status-bar@1.0.12
Local package version is up-to-date: modules@0.6.5
Local package version is up-to-date: modules-runtime@0.6.5
Local package version is up-to-date: mongo@1.1.9_1
Local package version is up-to-date: mongo-id@1.0.5
Local package version is up-to-date: npm-mongo@1.4.45
Local package version is up-to-date: observe-sequence@1.0.12
Local package version is up-to-date: ordered-dict@1.0.8
Local package version is up-to-date: promise@0.7.3
Local package version is up-to-date: random@1.0.10
Local package version is up-to-date: reactive-var@1.0.10
Local package version is up-to-date: reload@1.1.10
Local package version is up-to-date: retry@1.0.8
Local package version is up-to-date: routepolicy@1.0.11
Local package version is up-to-date: spacebars@1.0.12
Local package version is up-to-date: spacebars-compiler@1.0.12
Local package version is up-to-date: standard-minifier-css@1.0.8
Local package version is up-to-date: standard-minifier-js@1.0.8
Local package version is up-to-date: templating@1.1.13
Local package version is up-to-date: templating-tools@1.0.4
Local package version is up-to-date: tracker@1.0.14
Local package version is up-to-date: ui@1.0.11
Local package version is up-to-date: underscore@1.0.9
Local package version is up-to-date: url@1.0.10
Local package version is up-to-date: webapp@1.2.10
Local package version is up-to-date: webapp-hashing@1.0.9

Unable to resolve some modules:

“./node_modules/meteor/allow-deny/allow-deny.js” in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/allow-deny.js (os.linux.x86_64)
"./node_modules/meteor/babel-runtime/babel-runtime.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/babel-runtime.js (os.linux.x86_64)
"./node_modules/meteor/check/match.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/check.js (os.linux.x86_64)
"./node_modules/meteor/ddp-server/stream_server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ddp-server.js (os.linux.x86_64)
"./node_modules/meteor/ddp-server/livedata_server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ddp-server.js (os.linux.x86_64)
"./node_modules/meteor/ddp-server/writefence.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ddp-server.js (os.linux.x86_64)
"./node_modules/meteor/ddp-server/crossbar.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ddp-server.js (os.linux.x86_64)
"./node_modules/meteor/ddp-server/server_convenience.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ddp-server.js (os.linux.x86_64)
"./node_modules/meteor/ecmascript-runtime/runtime.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/ecmascript-runtime.js (os.linux.x86_64)
"./node_modules/meteor/es5-shim/server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/es5-shim.js (os.linux.x86_64)
"./node_modules/meteor/geojson-utils/main.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/geojson-utils.js (os.linux.x86_64)
"./node_modules/meteor/logging/logging.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/logging.js (os.linux.x86_64)
"./node_modules/meteor/modules/server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/modules.js (os.linux.x86_64)
"./node_modules/meteor/mongo/mongo_driver.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/oplog_tailing.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/observe_multiplex.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/doc_fetcher.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/polling_observe_driver.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/oplog_observe_driver.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/local_collection_driver.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/remote_collection_driver.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/mongo/collection.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/mongo.js (os.linux.x86_64)
"./node_modules/meteor/promise/server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/promise.js (os.linux.x86_64)
"./node_modules/meteor/random/random.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/random.js (os.linux.x86_64)
"./node_modules/meteor/random/deprecated.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/random.js (os.linux.x86_64)
"./node_modules/meteor/webapp-hashing/webapp-hashing.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/webapp-hashing.js (os.linux.x86_64)
"./node_modules/meteor/webapp/webapp_server.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/server/packages/webapp.js (os.linux.x86_64)
"./client/template.main.js" in /home/curlynux/Documents/dev/sampleTest/android/bundle/programs/web.browser/3c61c0649d35a32ba6f1d40551f2fb847001551a.js (os.linux.x86_64)

Preparing Cordova project from app bundle
Copying resources for mobile apps
Writing new config.xml
Preparing Cordova project for platform Android
% Executing “before_prepare” hook for all plugins.
% Searching PlatformJson files for differences between project vs. platform installed plugins
% No differences found between project and android platform. Continuing…
% Generating config.xml from defaults for platform “android”
% Wrote out Android application name to “sampleTest”
% Wrote out Android package name to “com.id17a7coc1l73bmms74z9d”
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-hdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-hdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-ldpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-mdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-xhdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-ldpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-mdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-hdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-ldpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-mdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-xhdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xhdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxhdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxxhdpi/icon.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_mdpi.icon.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-mdpi/icon.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_hdpi.icon.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-hdpi/icon.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_xhdpi.icon.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xhdpi/icon.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_xxhdpi.icon.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxhdpi/icon.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_xxxhdpi.icon.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxxhdpi/icon.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-hdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-hdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-ldpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-mdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-xhdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-ldpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-mdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-hdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-ldpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-mdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-xhdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xhdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxhdpi/screen.png
% Deleted /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-xxxhdpi/screen.png
% splash screens: [{“src”:“resources/android_mdpi_portrait.splash.png”,“density”:“port-mdpi”,“platform”:“android”,“width”:320,“height”:470},{“src”:“resources/android_mdpi_landscape.splash.png”,“density”:“land-mdpi”,“platform”:“android”,“width”:470,“height”:320},{“src”:“resources/android_hdpi_portrait.splash.png”,“density”:“port-hdpi”,“platform”:“android”,“width”:480,“height”:640},{“src”:“resources/android_hdpi_landscape.splash.png”,“density”:“land-hdpi”,“platform”:“android”,“width”:640,“height”:480},{“src”:“resources/android_xhdpi_portrait.splash.png”,“density”:“port-xhdpi”,“platform”:“android”,“width”:720,“height”:960},{“src”:“resources/android_xhdpi_landscape.splash.png”,“density”:“land-xhdpi”,“platform”:“android”,“width”:960,“height”:720},{“src”:“resources/android_xxhdpi_portrait.splash.png”,“platform”:“android”,“width”:1080,“height”:1440},{“src”:“resources/android_xxhdpi_landscape.splash.png”,“platform”:“android”,“width”:1440,“height”:1080}]
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_mdpi_portrait.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-mdpi/screen.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_mdpi_landscape.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-mdpi/screen.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_hdpi_portrait.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-hdpi/screen.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_hdpi_landscape.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-hdpi/screen.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_xhdpi_portrait.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-port-xhdpi/screen.png
% copying image from /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/resources/android_xhdpi_landscape.splash.png to /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/res/drawable-land-xhdpi/screen.png
% updated project successfully
% Executing “after_prepare” hook for all plugins.

WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on the same network, and that the network configuration allows clients
to talk to each other (no client isolation).
Running Cordova app for platform Android with options --device
ANDROID_HOME=/home/curlynux/Android/Sdk/
JAVA_HOME=/usr/java/jre1.8.0_91/bin/java
Starting app on Android Device |
ERROR: JAVA_HOME is set to an invalid directory: /usr/java/jre1.8.0_91/bin/java

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Error code 1 for command: /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true undefined
=> Errors executing Cordova commands:

While running Cordova app for platform Android with options --device:
Error: Command failed: /home/curlynux/Documents/dev/sampleTest/.meteor/local/cordova-build/platforms/android/cordova/run --device

at ChildProcess.exitCallback (/tools/utils/processes.js:151:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)

/home/curlynux/.meteor/packages/meteor-tool/.1.3.4_4.845h3e++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/isopackets/cordova-support/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:165
throw error;
^
ExitWithCode:1