热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Ubuntu12.04server搭建Android开发环境记录

本文章是自己搭建Android开发环境遇到的一些问题,自己给自己留个记录,很多都是参考网络上给的解决办法。本人的用的ubuntu12.04的server

本文章是自己搭建Android开发环境遇到的一些问题,自己给自己留个记录,很多都是参考网络上给的解决办法。本人的用的ubuntu 12.04的server版本,支持root登录,所以第一步的root搞起,sudo passwd root

1、ubuntu 12.04 server 安装后找不到eth0

修改:

root@miyh:~# vim /etc/network/interfaces
添加
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

 

2、Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.2.44

root@miyh:~# git 发现提示上述错误
修改
:
root@miyh:~# apt-get install language-pack-en-base
root@miyh:~#vim .bashrc
添加:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

重启shell终端,输入git,你会发现提示变了
root@miyh
:~# git
The program 'git' is currently not installed.  You can install it by typing:
apt-get install git

 

3、git获取

root@miyh:~# apt-get install git

安装的过程中,可以看到有这样的提示

Suggested packages:
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb

root@miyh:~# apt-get install git-doc

可以支持git + Table的操作

 

4、apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

原文:http://www.douban.com/note/240118681/

1. Download the JDK 1.6 binary release from Sun JDK download site(www.oracle.com/technetwork/java/javase/downloads/index.html).

2. Unzip the binary somewhere in your system, for example:
sudo mkdir -p /opt/java/64/
sudo cp jdk-6u35-linux-x64.bin /opt/java/64
sudo su -
cd /opt/java/64
chmod +x jdk-6u35-linux-x64.bin
./jdk-6u35-linux-x64.bin
exit

3. Add the new Java to your shell environment’s $PATH :
echo 'export PATH=/opt/java/64/jdk1.6.0_35/bin:$PATH' >> ~/.bashrc

4. Relaunch your terminal and test, java -version:
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)

 

5、Ubuntu 12.04 安装设置gcc4.4

apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50

update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100

update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

 

6、scripts/kconfig/lxdialog/msgbox.o: In function `dialog_msgbox': error
root@miyh:/usr/bin
# apt-get install libncurses5-dev

 

7、ImportError: No module named M2Crypto
root@miyh:/usr/bin# apt-get install python-dev
root@miyh:/usr/bin
# apt-get install libncurses5-dev

 

8、dos2unix:Command not found

root@miyh:/usr/bin# apt-get install dos2unix

 

9、collect2: ld terminated with signal 9 [Killed]
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES

修改ubuntu swap分区大小

root@miyh:~# mkdir swap

root@miyh:~# cd swap/
root@miyh:~/swap# pwd
/root/swap

root@miyh:~/swap#dd if=/dev/zero of=swapfile bs=1M count=2k

2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 16.3087 s, 132 MB/s

创建2G的swap,创建分区的大小就= bs * count(我机器配置的1G内存)

root@miyh:~/swap# mkswap swapfile

Setting up swapspace version 1, size = 2097148 KiB

no label, UUID=5fe50bd2-d575-40d6-a297-f827bbf9901e

转换成 Swap 文件

如果想一直使用这个swap分区,需要修改

root@miyh:~/swap# vim  /etc/fstab

/root/swap/swapfile swap swap defaults 0 0

 

10、lzop: error while loading shared libraries: liblzo2.so.2: cannot open shared object file: No such file or directory

root@miyh:/usr/lib/i386-linux-gnu# apt-get install liblzo2-dev

root@miyh:/usr/local/li/usr/lib/x86_64-linux-gnu/liblzo2.so.2b# find / -name liblzo2.so.2

/usr/lib/x86_64-linux-gnu/liblzo2.so.2

root@miyh:/usr/local/lib# ln -s /usr/lib/x86_64-linux-gnu/liblzo2.so.2 /usr/lib/liblzo2.so.2

 

11、lzop: error while loading shared libraries: liblzo2.so.2: wrong ELF class: ELFCLASS64

root@miyh:/usr/lib# apt-get install liblzo2-dev:i386

root@miyh:/usr/local/li/usr/lib/x86_64-linux-gnu/liblzo2.so.2b# find / -name liblzo2.so.2

/usr/lib/i386-linux-gnu/liblzo2.so.2
/usr/lib/x86_64-linux-gnu/liblzo2.so.2

root@miyh:/usr/lib# ln -s /usr/lib/i386-linux-gnu/liblzo2.so.2 /usr/lib/liblzo2.so.2


推荐阅读
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • WhenIusepythontoapplythepymysqlmoduletoaddafieldtoatableinthemysqldatabase,itdo ... [详细]
author-avatar
爱情丫丫2502895047
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有