ubuntu 9.10 android 2.1r2 java1.6.0_20

 

http://blog.csdn.net/skywalkzf/


http://www.yhsafe.com/article/2010/0317/article_1558.html

Ubuntu9.10编译android-2.1_r2源码
2010-03-17 11:01:32  作者:  来源:互联网  浏览次数:0  文字大小:【大】【中】【小】
  关于android源码编译的资料网上挺多,开头要装一大堆东西。我比较追求完美,不需要的坚决不装,所以我采取了如下编译过程:Ubuntu9.10默认安装的纯净系统,没装任何其他软件。1.下载源码android-2.1_r2,直接ma ...
关于android源码编译的资料网上挺多,开头要装一大堆东西。我比较追求完美,不需要的坚决不装,所以我采取了如下编译过程:

Ubuntu9.10默认安装的纯净系统,没装任何其他软件。

1.下载源码android-2.1_r2,直接make
2.出错及解决如下:
(1)/bin/bash: bison: command not found
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install bison
(2)make: *** No rule to make target `Please-install-JDK-5.0,-update-12-or-higher,-which-you-can-download-from-java.sun.com',
needed by `out/target/common/docs/api-stubs-timestamp'.  Stop.
解决:安装JDK 5.0
   1):根据官方文档里所说,源代码的编译必须使用JDK5才能编译的了,所以这里我们使用jdk5
   2): 需要先更新源,在终端里执行 sudo vim /etc/apt/sources.list
   3): 在source.list里把以下2行拷贝到文档最后面:
       deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
       deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
       保存退出。
   4): 执行 sudo apt-get update 更新源.
   5): 配置编译环境并下载JDK5:sudo apt-get install sun-java5-jdk
(3)/bin/bash: g++: command not found
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 127
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install build-essential
(4)external/clearsilver/cgi/cgi.c:22:18: error: zlib.h: No such file or directory
external/clearsilver/cgi/cgi.c: In function ‘cgi_compress’:
external/clearsilver/cgi/cgi.c:885: error: ‘z_stream’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:885: error: (Each undeclared identifier is reported only once
external/clearsilver/cgi/cgi.c:885: error: for each function it appears in.)
external/clearsilver/cgi/cgi.c:885: error: expected ‘;’ before ‘stream’
external/clearsilver/cgi/cgi.c:888: error: ‘stream’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:888: error: ‘Bytef’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:888: error: expected expression before ‘)’ token
external/clearsilver/cgi/cgi.c:889: error: ‘uInt’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:889: error: expected ‘;’ before ‘str’
external/clearsilver/cgi/cgi.c:890: error: expected expression before ‘)’ token
external/clearsilver/cgi/cgi.c:892: error: ‘uLong’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:892: error: expected ‘)’ before ‘stream’
external/clearsilver/cgi/cgi.c:895: error: ‘alloc_func’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:895: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:896: error: ‘free_func’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:896: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:897: error: ‘voidpf’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:897: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFAULT_COMPRESSION’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFLATED’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘MAX_WBITS’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFAULT_STRATEGY’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:901: error: ‘Z_OK’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:904: error: ‘Z_FINISH’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:905: error: ‘Z_STREAM_END’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c: In function ‘cgi_output’:
external/clearsilver/cgi/cgi.c:1200: error: ‘Z_NULL’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:1201: error: expected ‘)’ before ‘Bytef’
external/clearsilver/cgi/cgi.c:1218: error: ‘Z_DEFLATED’ undeclared (first use in this function)
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install zlib1g-dev
(5)/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install flex
(6)/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install libncurses-dev
(7)prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55:22: error: X11/Xlib.h: No such file or directory
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:56:23: error: X11/Xatom.h: No such file or directory
In file included from external/qemu/android/skin/window.c:19:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:73: error: expected specifier-qualifier-list before ‘XEvent’
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:86: error: expected specifier-qualifier-list before ‘Display’
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/skin/window.o] Error 1
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install libx11-dev
(8)sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install gperf

 

 

http://hi.baidu.com/maxgoto/blog/item/fa000f7bf01135f80ad187d8.html

Ubuntu 9.10系统Android 2.1编译笔记
2010-04-11 02:18

最近下载了Android 2.1源码,在Ubuntu 9.10上做了一次编译,由于系统为纯净系统,之前没有进行过任何Android的编译,所以需先安装一些必要软件。编译过程参考网上一些文章,做下笔记如下,以供参考:

1. 下载或更新Android源码至最新,截止到前天(04-09)好像是2.1-r2.

2. Android 要求的 jdk 1.5,而Ubuntu9.10的源里只有JDK1.6. 目前网上解决方法有两种:
    解决方法一:安装JDK1.5
   1) 根据官方文档里所说,源代码的编译必须使用JDK5才能编译的了,所以这里我们使用jdk5
   2) 需要先更新源,在终端里执行 sudo vim /etc/apt/sources.list
   3) 在source.list里把以下2行拷贝到文档最后面:
        deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
        deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
        保存退出。
   4) 执行 sudo apt-get update 更新源.
   5) 配置编译环境并下载JDK5:sudo apt-get install sun-java5-jdk
   解决方法二:安装JDK 1.6, 修改Android源文件。
   1) 安装jdk 1.6,修改<src_top/build/core/make.mk>(如果2.0版本源码请修改<src_top/build/core/main.mk>)
    在文件中搜索并分别把:
        java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1/.5[/. "$$]')
        javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1/.5[/. "$$]')
    两行改成:
        java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1/.6[/. "$$]')
        javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1/.6[/. "$$]')
    即可。
   推荐使用第一种解决方法。

3. 安装编译过程中必需软件。根据网上高人的经验,这是编译的最小工具软件集。
    $sudo apt-get install build-essential
    $sudo apt-get install zlib1g-dev
    $sudo apt-get install flex
    $sudo apt-get install libncurses-dev
    $sudo apt-get install libx11-dev
    $sudo apt-get install gperf

4. make .经过漫长的编译过程,编译成功。

参考:http://www.yhsafe.com/article/2010/0317/article_1558.html
          http://blog.csdn.net/skywalkzf/archive/2010/04/07/5458616.aspx

 

 

 

 

在SUN官方网站上下载jdk-6u20-linux-i586.bin,然后直接安装,安装完成后设置以下几个环境变量即可:

export JAVA_HOME=/home/dev/developer/java/jdk1.6.0_20
export JAVA_BIN=/home/dev/developer/java/jdk1.6.0_20/bin

export CLASSPATH=/home/dev/developer/java/jdk1.6.0_20/lib:/home/dev/developer/java/jdk1.6.0_20/jre/lib:$CL
ASSPATH
export PATH=/home/dev/developer/java/jdk1.6.0_20/bin:/home/dev/developer/java/jdk1.6.0_20/jre/bin:$PATH

测试一下:

dev@dev-desktop:~$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
dev@dev-desktop:~$


=====================================================================================
http://java.sun.com/javase/6/webnotes/install/jdk/install-linux-self-extracting.html

JavaTM SE 6 Release Notes
JDK Self-Extracting Binary Installation for Linux (32-bit)


Installation Instructions
This procedure installs the Java Development Kit (JDK) for 32-bit Linux, using a self-extracting binary file. The JDK download includes the Java SE Runtime Environment (JRE) – you do not have to download the JRE separately.

For RPM-based Linux distributions, like Red Hat or SuSE, refer to the RPM installation instructions.

The name of the downloaded file has the following format:

    jdk-6u<version>-linux-i586.bin
where <version> is the particular version number, for example:
    jdk-6u18-linux-i586.bin
To install, download this file and use the following instructions.


1. Download and check the download file size.


You can download to any directory that you can write to.

This bundle can be installed by anyone (not only root users), in any location that the user can write to. However, only the root user can displace the system version of the Java platform supplied by Linux.

2. Make sure that execute permissions are set on the self-extracting binary.
Run this command:
% chmod a+x jdk-6u<version>-linux-i586.bin
3. Change directory to the location where you would like the files to be installed.

The next step installs the JDK into the current directory.
4. Run the self-extracting binary.

Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with "./" (necessary if "." is not in the PATH environment variable):
% ./jdk-6u<version>-linux-i586.bin

The binary code license is displayed, and you are prompted to agree to its terms.

The JDK files are installed in a directory called jdk1.6.0_<version> in the current directory. Follow this link to see its directory structure. The JDK documentation is a separate download.

5. Delete the bin file if you want to save disk space.

6. If you want to use Java within the browser, setup the plugin using the instructions in Manual Plugin Installation for Linux.


 

Note about Root Access: Installing the software automatically creates a directory called jdk1.6.0_<version>. Note that if you choose to install the JDK into a system-wide location such as /usr/local, you must first become root to gain the necessary permissions. If you do not have root access, simply install the Java SE Runtime Environment into your home directory, or a subdirectory that you have permission to write to.
Note about Overwriting Files: If you install the software in a directory that contains a subdirectory named jdk1.6.0_<version>, the new software overwrites files of the same name in that jdk1.6.0_<version> directory. Please be careful to rename the old directory if it contains files you would like to keep.

Note about System Preferences: By default, the installation script configures the system such that the backing store for system preferences is created inside the JDK's installation directory. If the JDK is installed on a network-mounted drive, it and the system preferences can be exported for sharing with Java runtime environments on other machines.


See the Preferences API documentation for more information about preferences in the Java platform.

=====================================================================================
http://java.sun.com/javase/6/webnotes/install/jre/install-linux-self-extracting.html

JavaTM SE 6 Release Notes
JRE Self-Extracting Binary Installation for Linux (32-bit)
 


Installation Instructions
This procedure installs the Java SE Runtime Environment for 32-bit Linux, using a self-extracting binary file. For RPM-based Linux distributions, like Red Hat or SuSE, refer to the RPM installation instructions.

The name of the downloaded file has the following format:

    jre-6u<version>-linux-i586.bin
where <version> is the particular version number, for example:
    jre-6u18-linux-i586.bin
To install, download this file and use the following instructions.


1. Download and check the download file size.


You can download to any directory that you can write to.

This bundle can be installed by anyone (not only root users), in any location that the user can write to. However, only the root user can displace the system version of the Java platform supplied by Linux.

2. Make sure that execute permissions are set on the self-extracting binary.
Run this command:
% chmod a+x jre-6u<version>-linux-i586.bin
3. Change directory to the location where you would like the files to be installed.

The next step installs the Java SE Runtime Environment into the current directory.
4. Run the self-extracting binary.

Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with "./" (necessary if "." is not in the PATH environment variable):
% ./jre-6u<version>-linux-i586.bin

The binary code license is displayed, and you are prompted to agree to its terms.

The Java SE Runtime Environment files are installed in a directory called jre1.6.0_<version> in the current directory. Follow this link to see its directory structure.

5. Delete the bin file if you want to save disk space.

6. If you want to use Java within the browser, setup the plugin using the instructions in Manual Plugin Installation for Linux.


 

Note about Root Access: Installing the software automatically creates a directory called jre1.6.0_<version>. Note that if you choose to install the Java SE Runtime Environment into system-wide location such as /usr/local, you must first become root to gain the necessary permissions. If you do not have root access, simply install the Java SE Runtime Environment into your home directory, or a subdirectory that you have permission to write to.
Note about Overwriting Files: If you install the software in a directory that contains a subdirectory named jre1.6.0_<version>, the new software overwrites files of the same name in that jre1.6.0_<version> directory. Please be careful to rename the old directory if it contains files you would like to keep.

Note about System Preferences: By default, the installation script configures the system such that the backing store for system preferences is created inside the Java SE Runtime Environment's installation directory. If the JRE is installed on a network-mounted drive, it and the system preferences can be exported for sharing with Java runtime environments on other machines.


See the Preferences API documentation for more information about preferences in the Java platform.


=====================================================================================
http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

JavaTM SE 6 Release Notes
Manual Installation and Registration of Java Plugin for Linux

When you install the Java platform, the Java plugin file is included as part of that install. If you want to use Java within Firefox, you need to manually create a symbolic link from the plugin file in the release to one of the locations that Firefox expects. To make the plugin available to all users, create the link inside of the Firefox application's directory, in the plugins subdirectory. Alternatively, you can create the symbolic link in your home directory, in ~/.mozilla/plugins. In the remainder of this document, the text, "Firefox plugins directory", implies either of these locations.

This release provides the Next-Generation Java plugin. If you have been using the classic plugin, see the Notes for further information.

The plugin file for Linux is located here:

    <JRE>/lib/i386/libnpjp2.so
If you are using a 32-bit Firefox, you should use the 32-bit Java Plugin (from the lib/i386 directory). To determine which version of Firefox you are running, launch the application, and select the menu item Help -> About Mozilla Firefox. At the bottom of the window is a version string line that contains either "Linux i686" (32-bit) or "Linux x86_64" (64-bit).

To install the Java Plugin follow these steps:

1. Exit Firefox.

2. Uninstall any previous installations of Java Plugin.

Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one.

Remove the symbolic links (or move them to another directory) to javaplugin-oji.so and libnpjp2.so from the Firefox plugins directory.

3. Create a symbolic link to the Java Plugin in the Firefox plugins directory.

Create a symbolic link to the Java Plugin libnpjp2.so file in the Firefox plugins directory:

    cd <Firefox>/plugins
    ln -s <JRE>/lib/i386/libnpjp2.so .

4. Start the Firefox browser.


Type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.


 

Notes

The classic plugin file was located here:
    <JRE>/plugin/i386/javaplugin-oji.so
This file should no longer be used and all symbolic links to it removed.

=====================================================================================

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章