title: getting error, while adding android platform for phonegap
body: <p>Today I started <code>phonegap</code>, as per documentation I am trying to setup my environment into my local machine. </p>
  
  <p>In this process, I installed <code>android SDK</code> and set the environment variables in <code>bashrc</code> file.</p>
  
  <pre><code>PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
  JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
  export JAVA_HOME
  PATH=$PATH:$JAVA_HOME
  
  ANDROID_HOME=$HOME/Git/adt-bundle-linux/sdk
  export ANDROID_HOME
  PATH=$PATH:$ANDROID_HOME
  
  ANDROID_PLATFORM_TOOLS=$ANDROID_HOME/platform-tools
  export ANDROID_PLATFORM_TOOLS
  PATH=$PATH:$ANDROID_PLATFORM_TOOLS
  
  ANDROID_TOOLS=$ANDROID_HOME/tools
  export ANDROID_TOOLS
  PATH=$PATH:$ANDROID_TOOLS
  export PATH
  
  ANT_HOME=/usr/share/ant
  export ANT_HOME
  PATH=$PATH:$ANT_HOME/bin
  </code></pre>
  
  <p>I switch to my working director and getting the following error after ran the <code>cordova platform add android</code></p>
  
  <pre><code>Creating android project...
  
  /home/.cordova/lib/npm_cache/cordova-     
  android/3.6.3/package/bin/node_modules/q/q.js:126
                  throw e;
                        ^
  Error: Failed to run "javac -version", make sure you have a Java JDK (not just a JRE) installed.
  at /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:43:27
  at ChildProcess.exithandler (child_process.js:651:7)
  at ChildProcess.EventEmitter.emit (events.js:98:17)
  at maybeClose (child_process.js:753:16)
  at Process.ChildProcess._handle.onexit (child_process.js:820:5)
  Error: /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/create: Command failed with exit code 8
  at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
  at ChildProcess.EventEmitter.emit (events.js:98:17)
  at maybeClose (child_process.js:753:16)
  at Process.ChildProcess._handle.onexit (child_process.js:820:5)
  @barrett:~/Git/phonegap/hellowPhonegap$
  </code></pre>
  
  <p>same command ran with "sudo" like <code>sudo cordova platform add android</code>, throwing the following error.</p>
  
  <pre><code> /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:126
                  throw e;
                        ^
  Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
  at /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:158:19
  at _fulfilled (/home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:798:54)
  at self.promiseDispatch.done (/home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:827:30)
  at Promise.promise.promiseDispatch (/home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:760:13)
  at /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:821:14
  at flush (/home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:419:13)
  at Function.Module.runMain (module.js:499:11)
  at startup (node.js:119:16)
  at node.js:906:3
  Error: /home/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/create: Command failed with exit code 8
  at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
  at ChildProcess.EventEmitter.emit (events.js:98:17)
  at maybeClose (child_process.js:753:16)
  at Process.ChildProcess._handle.onexit (child_process.js:820:5)
  </code></pre>
  
  <p>Which command shall I use later. If one of it,what's the problem.</p>
  
  <p>can anyone help me. </p>