Development of Android environment variable settings in 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

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

Step 1: Configure Environment Variables
Sudo gedit ~ /. Profile

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:
The default AVD directory for Android is/home/CMM/. Android/AVD.

Use the above android_sdk_home settings, and thenRestartMachine (it seems that the server must be restarted, or the setting cannot take effect ),

In this way, the AVD Creation Path becomes user-defined.

Step 2: Save and close. Use source to update
$ Source ~ /. Profile

 

Step 3: Use the Env command to view the java_home Value
$ ENV
If java_home =/usr/lib/JVM/jdk1.7.0 _ 04, the configuration is successful.

Refer:
Install and configure Java JDK in Ubuntu 12.04
Http://www.cnblogs.com/bluestorm/archive/2012/05/10/2493592.html

Note:
1. $ identifies the environment variable, that is, it has been previously defined. Here, it is directly called by value assignment;
2. Multiple paths are separated by colons (:)
3. Set the system environment variables to/etc/profile, and set the user's personal environment variables :~ /. Profile
4. Set the command line environment to bashrc. You can edit the command:
Sudo gedit ~ /. Bashrc

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

Additional reading:

1. "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", and other paths are already in the system environment variables. now, if the executable file is in these standard locations, enter the file name and parameters of the executable file of the software in the terminal command line (if you need parameters), press Enter.

 

2. If the file name is not in the standard position, add the complete path before the file name. However, it is too troublesome to run like this every time. A "once and for all" method is to add this path to the environment variable. The command "Path = $ path: path" can add this path to the environment variable, but exit this command line will become invalid. To take effect permanently, add this line to the environment variable file. Two files are available: "/etc/profile" and ". bash_profile "and"/etc/profile "are valid for all users in the system. bash_profile "is only valid for this user.

(Note: system environment variable configuration file:/etc/profile, environment variable configuration file in the personal user directory under Ubuntu :~ /. Profile)

 

3. In "Profile" and ". bash_profile", "#" is a annotator, which has no effect except visual separation.

"Path = $ path: Path 1: Path 2 :...: path N, which indicates that the path of the executable file includes the original path, and all paths from "Path 1" to "path N. After you enter a string of characters and press enter, shell finds the corresponding executable files in these paths and submits them to the system core for execution. The "$ path" indicates that the previously set path is still valid. Do not miss it. Some software may have environment variables other than "path" that need to be added, but the method is the same, and you also need to pay attention to "$ ".

Note: Unlike DOS/window, path names in Unix-type system environment variables are separated by colons instead of semicolons. In addition, the more software is installed, the more environment variables are added. To avoid confusion, we recommend that all statements be added at the end of the file.
  Format:
Path = $ path: Path 1: Path 2:...: path n
Other environment variables = $ other environment variables :...

 

 

Related Article

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.