The following reference online a lot of information, their own test success.
1. Download the JDK and install:
: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Download the default path in Downloads, first set up an installation of the decompression path:
sudo mkdir/opt/java
Next go to the downloaded path and move the file to the new path below:
CD downloads/
sudo mv jdk-8u40-linux-i586.tar.gz/opt/java/
Then unzip under this path (do not delete, after success):
sudo tar -zxvf jdk-8u40-linux-i586.tar.gz
After decompression, configure the relevant environment variables:
sudo gedit/etc/profile
Add the following lines of code at the end of the file:
#set Java Environment
Export java_home=/opt/java/jdk1.8.0_40
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
Save close file, log off the computer to see if the installation was successful
Open Terminal, enter:
Java-version
Display information:
Indicates successful installation
2. Download and install ADT
There are instructions on the Internet:
Google Now offers an SDK that includes Eclipse, and ADT, so it's no longer as cumbersome to install it as before.
Download ADT bundle:http://developer.android.com/sdk/index.html on the Android website
Download for Linux 64-bit version here: Adt-bundle-linux-x86_64-20140321.zip
However, do not turn over the wall is not downloaded.Therefore, provide an address that does not have to be flipped:
Http://www.cnblogs.com/tc310/p/3938353.html
Thank you for sharing this brother.
Then unzip the file under the home folder:
CD downloads/
MV Adt-bundle-linux-x86-20140702.zip ~
Because the file type is: Zip, the extracted command is:unzip
Cd..
Unzip Adt-bundle-linux-x86-20140702.zip
After the decompression is complete, the installation is ready.
Problems that exist:
3. Android NDK Installation
: http://down.tech.sina.com.cn/page/52981.html (no need to flip the wall)
After the download is complete, the same decompression, configuration environment variables:
sudo tar jxvfandroid-ndk-r9c-linux-x86.tar.bz2
When the decompression is complete, configure the environment variables:
To modify the currently logged on user profile:
~sudo gedit ~/.profile
To modify the system configuration file:
~$ su do gedit/etc/profile
Configure environment variables on the inside: # set NDK enviroment
Export android_ndk=/opt/java/android-ndk-r9c
Export path= $ANDROID _NDK: $PATH
Use the. command to make it effective (you can also log off the computer):
~/etc/profile
Enter in Terminal: Ndk-build display:
Indicates successful installation
4. opencv4android Download Installation
:
http://sourceforge.net/projects/opencvlibrary/files/
Download the extract later, and then copy the SDK folder inside the workspace.
In use, in the ADT Project to import it!
Appendix:
It is said that there are four places that can be configured, but the scope of their action and the operation in effect are different. See for yourself:
1. Environment of the System 2. User Set Environment information 3. User information for bash Shell 4. Bash Shell bash information
The difference between them is:
Etc/environment: Setting the entire system environment, regardless of the logged-on user
/etc/profile: Sets the environment information for each user of the system, and when the user first logs on, the file is executed and the shell's settings are collected from the configuration file in the/ETC/PROFILE.D directory
/ETC/BASH.BASHRC: Executes this file for each user running the bash shell. When the bash shell is opened, the file is read.
~/.BASHRC: This file contains bash information dedicated to the logged-on User bash shell, which is read when logging in and every time a new shell is opened. It can use these environment variables to control the permissions to the user level, if you need to give a user permissions to use these environment variables, you just need to modify their personal user home directory of the. bashrc file on it.
Effective time for each configuration:
/etc/environment: Restart effective
/etc/profile: Log off after logging in effect, also can. /etc/profile make it effective
/ETC/BASH.BASHRC: Re-opening bash shell takes effect
~/.BAHSRC: Re-opening bash shell takes effect
Finally, remove the package from the JDK, etc.
Reference documents:
Http://blog.sina.com.cn/s/blog_4c8fbf480102uzcl.html
Ubutu 14.04 Installation configuration Android OPENCV development environment