Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The path of my .basrc file is

/home/vamsi/.bashrc

It is weird that my file has nothing but the path I set. I think I am using a file at the wrong location or that I have lost my .bashrc file as none of the environment variables set here seem to work.

#ANDROID_DEV
ANDROID_HOME=/opt/android-sdk-linux
export ANDROID_HOME
PATH= $PATH:$ANDROID_SDK_HOME/tools
export PATH
PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH
PATH=$PATH:$ANDROID_HOME/build-tools
export PATH

#MAVEN-PATH
M2_HOME=/opt/apache-maven-3.1.0
export M2_HOME
M2=$PATH:$M2_HOME/bin
export M2

I was prompted to install maven2 in order to use mvn, but the android command cannot be found. Could you please help me find a solution to this issue.

EDIT:

Meanwhile,I tried this:

export PATH=${PATH}:/opt/android-sdk-linux/platform-tools
export PATH=${PATH}:/opt/android-sdk-linux/tools

Now,the output of $PATH echoes:

bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/build-tools: No such file or directory

NOW WORKING:
1. Used ANDROID_HOME instead of ANDROID_SDK_HOME
2. Removed space between = $PATH
3. Ran echo $PATH
4. Logged out and logged back in
5. Opened the terminal and tried android list targets

share|improve this question
    
What are you trying to do? If "vamsi"is your username, .bashrc is in right place. – khajvah Oct 27 '13 at 14:18
    
what does echo $PATH give you? – jbat100 Oct 27 '13 at 14:19
    
What has android do with your computer? Explain your problem – khajvah Oct 27 '13 at 14:19
    
I would like to add the Android sdk path to my environment variables in linux as I would like to try developing apps with ant and the sdk using a text editor of my choice. – vamsiampolu Oct 27 '13 at 14:52
2  
Your .bashrc is almost fine, there is one error, there should be no space between PATH= $PATH, change that to PATH=$PATH. To check if an environment variable has been set, run echo $PATH, not $PATH by itself. Now, what exactly do you want to add to your path and what makes you think it is not working? – terdon Oct 27 '13 at 15:32
up vote 1 down vote accepted

You haven't defined $ANDROID_SDK_HOME in the code you pasted. You only defined $ANDROID_HOME

edited to reflect terdon's comment.

share|improve this answer
    
+1 for ANDROID_SDK_HOME but the error is because the OP ran $PATH not echo $PATH, it does not mean the directory does not exist. – terdon Oct 27 '13 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .