Reproduced Developing Android environment variable settings under Ubuntu

Source: Internet
Author: User

-----------------------------------------------------
Android_sdk_home:
/home/cmm/avds

PATH:
/home/cmm/android-sdk-linux/tools;/home/cmm/android-sdk-linux/platform-tools

CLASSPATH:
$JAVA _home/lib: $JAVA _home/jre/lib

----------------------------------------------------------

STEP1: Configuring Environment variables
sudo gedit ~/.profile


At the end add:
Export Java_home=/usr/lib/jvm/jdk1.7.0_04
Export classpath= $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib
Export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin:/home/cmm/android-sdk-linux/tools:/home/cmm/ Android-sdk-linux/platform-tools
Export ANDROID_SDK_HOME=/HOME/CMM/AVDS

Problems that exist:
The default AVD creation directory for Android system in:/HOME/CMM/.ANDROID/AVD

By setting the item as above Android_sdk_home, and then restarting the machine (it seems to have to restart, otherwise the settings will not take effect),

The creation path of the AVD becomes user-definable.


STEP2: Then save off, use Source update under
$ source ~/.profile

STEP3: Use the ENV command to see the value of Java_home
$ env
If java_home=/usr/lib/jvm/jdk1.7.0_04, the configuration is successful.


Reference:
Installing and configuring Java JDK in Ubuntu 12.04
Http://www.cnblogs.com/bluestorm/archive/2012/05/10/2493592.html


Description
1. The $ symbol is identified as an environment variable, which is already defined in the preceding, and is directly assigned to the value call;
2. Multiple paths separated by colons (:)
3. System environment variable set in:/etc/profile, user personal environment variable set in: ~/.profile
4. Command line environment settings in BASHRC, can be ordered to edit:
sudo gedit ~/.BASHRC

----------------------------------------------------------

Extended reading:

1. "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin" and other paths are already in the system environment variables, if the executable file in these standard locations, enter the software executable file name and parameters in the terminal command line (If parameters are required), enter.

2. If not in a standard location, the file name needs to be preceded by a full path. But it's too much trouble to run like this every time, a "once and for all" approach is to add this path to the environment variable. The command "path= $PATH: Path" can add this path to an environment variable, but exiting the command line will fail. This line needs to be added to the environment variable file in order to be permanently active. There are two files to choose from: "/etc/profile" and ". Bash_profile" in the user's home directory, "/etc/profile" is valid for all users in the system, and ". Bash_profile" in the user's home directory is only valid for this user.

(Note: System environment variable profile:/etc/profile,ubuntu environment variable profile under personal User directory: ~/.profile)

3. In "Profile" and ". Bash_profile", "#" is a comment symbol, written here in addition to visual separation without any effect.

"Path= $PATH: Path 1: Path 2: ...: path n", which means that the path to the executable file includes the path originally set, and also includes all paths from "Path 1" to "Path N". When the user enters a string of characters and presses ENTER, the shell will find the corresponding executable file in these paths in turn and hand it over to the system core execution. The "$PATH" means that the path originally set is still valid, so be careful not to miss out. Some software may also have an environment variable of type "PATH" that needs to be added, but the method is the same, and you also need to be aware of "$".

Note that, unlike Dos/window, the path names in the UNIX class system environment variables are separated by colons, not semicolons. In addition, the more loaded the software, the more environment variables, in order to avoid confusion, we recommend that all statements are added at the end of the file
  Format:
Path= $PATH: Path 1: Path 2: ...: path n
Other environment variables =$ other environment variables: ...

Reproduced Developing Android environment variable settings under Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.