Ubuntu16.04上Android N开发环境配置

1.安装相关依赖库

  1. sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
  2. sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
  3. sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
  4. sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
  5. sudo apt-get install git-core gnupg flex bison gperf build-essential
  6. sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
  7. sudo apt-get install libc6-dev-i386
  8. sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
  9. sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
  10. sudo apt-get install lib32z-dev ccache

2.安装open JDK7

  1. sudo add-apt-repository ppa:openjdk-r/ppa
  2. sudo apt-get update
  3. sudo apt-get install openjdk-7-jdk

3.安装open JDK8

  1. sudo apt-get update
  2. sudo apt-get install openjdk-8-jdk


4.设置环境变量

输入如下命令打开profile文件

  1. $ sudo gedit /etc/profile

在文件末尾追加下面内容

  1. export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
  2. export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
  3. export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
  4. export PATH={JAVA_HOME}/bin:$PATH

然后执行如下命令更新配置

  1. source /etc/profile

输入

  1. echo $JAVA_HOME

如果输出为openjdk字样表示配置正确

5.linux 内核编译时出现scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h错误的解决办法

ubuntu下缺少了部分如下的组件,安装一下即可 
sudo apt-get install libssl-dev







你可能感兴趣的:(Android学习)