zoukankan      html  css  js  c++  java
  • Reinstall Ubuntu

    1. install jdk

    http://www.2cto.com/os/201111/110060.html

    http://hi.baidu.com/pj1990zp/item/7c9e9795681c65835814618e

    http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

    http://blog.csdn.net/microfhu/article/details/7667393

     

    配置默认使用的JDK版本

    sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300 
    sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300 
    sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300

    sudo update-alternatives --config java  

     输入1,2,3代表默认使用的jdk版本

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ sudo gedit ~/.bashrc
    JAVA_HOME=/opt/jdk1.6.0_38

    export JRE_HOME=$JAVA_HOME/jre
    export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ source ~/.bashrc
    ghostli123@ghostli123-HP-Pro-3380-MT:/$ java -version

    construct the environment of Android

    http://od-eon.com/blogs/alumni/horia/android-development-environment-setup-ubuntu-lucid/

    http://blog.sina.com.cn/s/blog_8d0447c901012gep.html

    http://byandby.iteye.com/blog/1159592

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ sudo gedit ~/.bashrc
    export JAVA_HOME=/usr/java/jdk1.6.0_38
    export JRE_HOME=/usr/java/jdk1.6.0_38/jre
    export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:~/Android/android-sdk-linux/tools:~/Android/android-sdk-linux/platforms$PATH

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ source ~/.bashrc

    sudo apt-get install ia32-libs 

    download ADT, first, go to the link here http://developer.android.com/tools/sdk/eclipse-adt.html to view the latest version and revise the number below:

    http://dl.google.com/android/ADT-16.0.1.zip

    2. update the source of apt-get

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ sudo gedit /etc/apt/sources.list

    #past the source to the sources.list which can be found by the link http://blog.csdn.net/fly542/article/details/6758342

    ghostli123@ghostli123-HP-Pro-3380-MT:/$ sudo apt-get update

    3. install tcpdump

    4. configure the environment for android development

    5. install adobe flash player

    http://www.2cto.com/os/201205/133528.html

    download and compile android source code

    http://www.2cto.com/kf/201111/111551.html 

    I get the error like this:

    /bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: Permission denied
    /bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: Permission denied
    /bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: Permission denied
    /bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
    build/core/config.mk:342: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.

    and then I revise the the permision by using the command like this:

    sudo chmod 777 WORKING_DIRECTORY

    and apply to all its sub folder manually.

    ghostli123@ghostli123-HP-Pro-3380-MT:~/WORKING_DIRECTORY$ lunch full-eng

    1. sudo apt-get install build-essential       2.  sudo apt-get install make       3.  sudo apt-get install gcc       4.  sudo apt-get install g++       5.  sudo apt-get install libc6-dev       6.         7.  sudo apt-get install patch       8.  sudo apt-get install texinfo       9.  sudo apt-get install libncurses-dev  11.  sudo apt-get install git-core gnupg      12.  sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev zip curl      13.  sudo apt-get install ncurses-dev       14.  sudo apt-get install zlib1g-dev      15.  sudo apt-get install valgrind      16.  sudo apt-get install python

    sudo apt-get install libxml2-utils

    sudo apt-get install ia32-libs

    编译android遇到gcc4.6版本太高问题

    http://yangguangwei1987.blog.163.com/blog/static/19521517820121855740687/

    3.2      i686-linux-gcc问题:

    3.2.1     问题描述

    prebuilts/tools/gcc-sdk/gcc: line 40: prebuilts/tools/gcc-sdk/http://www.cnblogs.com/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/i686-linux-gcc: No such file or directory

    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o] Error 127

    make: *** Waiting for unfinished jobs....

    prebuilts/tools/gcc-sdk/g++: line 40: prebuilts/tools/gcc-sdk/http://www.cnblogs.com/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/i686-linux-g++: No such file or directory

    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/slibhost_intermediates/pseudolocalize.o] Error 127

    Note: Some input files use or override a deprecated API.

    Note: Recompile with -Xlint:deprecation for details.

    3.2.2     产生原因

    漏掉了gcc相关包

    3.2.3     解决方法

    1、System------Administration------Synaptic Package Manager

    2、Search gcc, install gcc-multilib

    3.3      libz.so

    3.3.1     问题描述

    /work/android/Android4.1.2/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/../lib/gcc/i686-linux/4.6.x-google/http://www.cnblogs.com/http://www.cnblogs.com/i686-linux/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory.

    3.3.2     产生原因

    没有安装libz.so.1相关的工具包

    3.3.3     解决方法

    command: sudo apt-get install apt-file

    command: sudo apt-file update

    ghostli123@ghostli123-HP-Pro-3380-MT:~/WORKING_DIRECTORY$ apt-file search libz.so
    lib32z1: /usr/lib32/libz.so.1
    lib32z1: /usr/lib32/libz.so.1.2.3.4
    lib32z1: /usr/lib32/libz.so.1.2.7
    lib32z1-dev: /usr/lib32/libz.so
    lsb-build-base3: /usr/lib/lsb3/libz.so
    zlib1g: /lib/x86_64-linux-gnu/libz.so.1
    zlib1g: /lib/x86_64-linux-gnu/libz.so.1.2.3.4
    zlib1g: /lib/x86_64-linux-gnu/libz.so.1.2.7
    zlib1g-dbg: /usr/lib/debug/lib/libz.so.1.2.3.4
    zlib1g-dbg: /usr/lib/debug/lib/x86_64-linux-gnu/libz.so.1.2.3.4
    zlib1g-dbg: /usr/lib/debug/lib/x86_64-linux-gnu/libz.so.1.2.7
    zlib1g-dbg: /usr/lib/debug/usr/lib/libz.so.1.2.7
    zlib1g-dbg: /usr/lib/debug/usr/lib32/libz.so.1.2.3.4
    zlib1g-dbg: /usr/lib/debug/usr/lib32/libz.so.1.2.7
    zlib1g-dev: /usr/lib/x86_64-linux-gnu/libz.so

    3、依次安装the application before the comma

    In file included from external/qemu/android/skin/trackball.c:12:0:
    external/qemu/android/skin/trackball.h:15:17: fatal error: SDL.h: No such file or directory
    compilation terminated.
    In file included from external/qemu/android/skin/image.c:12:0:
    external/qemu/android/skin/image.h:16:17: fatal error: SDL.h: No such file or directory
    compilation terminated.
    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/emulator-libui_intermediates/android/skin/trackball.o] Error 1
    make: *** Waiting for unfinished jobs....
    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/emulator-libui_intermediates/android/skin/image.o] Error 1
    external/qemu/android/skin/keyset.c:16:17: fatal error: SDL.h: No such file or directoryIn file included from external/qemu/android/skin/keyboard.h:17:0,
                     from external/qemu/android/skin/keyboard.c:12:
    external/qemu/android/skin/image.h:16:17: fatal error: SDL.h: No such file or directory

    copy SDL folder in /usr/include/ to external/qemu/android/, and then revise the code #include <SDL.h> to #include "SDL/SDL.h"

    close the firewall

    sudo ufw disable

    make: *** No rule to make target `out/host/common/obj/JAVA_LIBRARIES/mockwebserver-hostdex_intermediates/javalib.jar', needed by `out/host/common/obj/JAVA_LIBRARIES/core-tests-hostdex_intermediates/classes-full-debug.jar'.  Stop.

    This is the solution in google group. It works well. Amazingly!  To rename mockwebserver-hostdex to mockwebserver-host in libcore/JavaLibrary.mk (line 155).

    G:\2013.01.21 Ubuntu\WORKING_DIRECTORY\build\core\host_java_library.mk

    34 full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar

    G:\2013.01.21 Ubuntu\WORKING_DIRECTORY\build\core\java.mk

    83 full_classes_compiled_jar_leaf := classes-full-debug.jar

    To run the compiled image of Android

    http://blog.csdn.net/super005/article/details/6968589

    Please export ANDROID_SWT to point to the folder containing swt.jar for your platform.
    export ANDROID_SWT=~/WORKING_DIRECTORY/out/host/linux-x86/framework

    emulator: ERROR: You did not specify a virtual device name, and the system
    directory could not be found.


    If you are an Android SDK user, please use '@<name>' or '-avd <name>'
    to start a given virtual device (see -help-avd for details).


    目前的解决方式是设置ANDROID_BUILD_TOP环境变量:
    如:export ANDROID_BUILD_TOP=/home/WORKING_DIRECTORYemulator: ERROR: You did not specify a virtual device name, and the system
    directory could not be found.


    If you are an Android SDK user, please use '@<name>' or '-avd <name>'
    to start a given virtual device (see -help-avd for details).

    jelly bean(adnroid4.1.1)下emulator不能直接运行的问题(我用的是4.2的也不行)
    在Android 2.3下只要设置了ANDROID_PRODUCT_OUT环境变量emulator就可以使用了,但是在android 4.1下就不能使用了
    只有刚刚make结束的时候的终端可以直接运行,新开一个终端就不行了,出现以下提示:
    emulator: ERROR: You did not specify a virtual device name, and the system
    directory could not be found.
    If you are an Android SDK user, please use '@<name>' or '-avd <name>'
    to start a given virtual device (see -help-avd for details).
    目前的解决方式是设置ANDROID_BUILD_TOP环境变量:
    如:export ANDROID_BUILD_TOP=/home/WORKING_DIRECTORY

  • 相关阅读:
    OpenCV 最小二乘拟合方法求取直线倾角
    BFS-hdu-4101-Ali and Baba
    手机安全卫士开发系列(1)——功能列表
    【Linux常用工具】1.1 diff命令的三种格式
    手机安全卫士开发系列(2)——splash界面
    Ruby学习笔记(二)
    jQuery Animation实现CSS3动画
    HDU2699+Easy
    android中解析文件的三种方式
    查找某元素
  • 原文地址:https://www.cnblogs.com/yangzhang/p/2869643.html
Copyright © 2011-2022 走看看