Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova platform add android JAVA_HOME error in Ubuntu

I'm trying to start android development with Cordova on Ubuntu. I can't add android platform for my project:

$ sudo cordova platform add android
Checking Android requirements...
[Error: ERROR : Make sure JAVA_HOME is set, as well as paths to your JDK and JRE for java.]

Environment checks:

$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

$ ant -version
Apache Ant(TM) version 1.8.2 compiled on May 18 2012

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/programs/adt-bundle/sdk/platform-tools:/programs/adt-bundle/sdk/tools

$ echo $JAVA_HOME
/usr/lib/jvm/jdk1.7.0_45

Eclipse ADT-Boundle is in /programs/adt-boundle folder

Please, tell me, why am I still getting this error?

[Error: ERROR : Make sure JAVA_HOME is set, as well as paths to your JDK and JRE for java.]
like image 412
Antonio Avatar asked Mar 26 '26 04:03

Antonio


1 Answers

This got rid of the JAVA_HOME error for me:

~/.bashrc file:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386

I also had to add:

export PATH=~/path/where/I/put/bundle/adt-bundle-linux-x86-20131030/sdk/tools
export PATH=~/path/where/I/put/bundle/adt-bundle-linux-x86-20131030/sdk/platform-tools

to get past another error

like image 96
Connor Leech Avatar answered Mar 28 '26 18:03

Connor Leech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!