嵌入式媒体的开发,大多要用到各种开源的东西,
如果要上android等框架,调试的前提往往是必须安装eclips等共具,本文介绍在没有网络条件下,如何手动安装elips到ubuntu:
1 下载eclips:
http://www.eclipse.org/downloads/
这里我们选择c,c++包下载,下载后安装如下步骤:
0down vote |
You can simply download the .tar.gz package from the eclipse website http://eclipse.org/downloads/?osType=linux , extract the package… then change the authorization of the file named eclipse by running the command
then everytime you want the IDE to run, just enter into the directory where the IDE is extracted by terminal and type….
done… 🙂 |
当然,安装后可能会有如下问题:
about_files artifacts.xml dropins eclipse.ini features libcairo-swt.so p2 readme
about.html configuration eclipse epl-v10.html icon.xpm notice.html plugins
root@ubuntu:/eclipse/eclipse# chmod 777 eclipse
root@ubuntu:/eclipse/eclipse# ./eclipse
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/eclipse/eclipse/jre/bin/java
java in your current PATH
原因是你还必须有java的虚拟机环境
2 java vm 的安装
2.1 方法一:非源码包的安装
下载地址:http://www.oracle.com/technetwork/java/javase/overview/index.html
这是要注册的,写很多东西,甲骨文不仅仅是数据库牛逼,逼人写信息也牛逼。。。。据称他们的收费也是第一
所以:如下地址也许更好:http://code.google.com/p/autosetup1/downloads/detail?name=jdk-6u20-linux-i586.bin&can=2&q=
拿到包以后安装:
2.1.1 root@ubuntu:/jdk# sudo chmod a+x jdk-6u20-linux-i586.bin
2.1.2 root@ubuntu:/jdk# ./jdk-6u20-linux-i586.bin
弹出:
Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA SE DEVELOPMENT KIT (JDK), VERSION 6
。。。 。。。
连续按回车直到显示要求输入yes/no,
Please enter "yes" or "no".
Do you agree to the above license terms? [yes or no]
yes
此时输入yes并回车,将会得到jdk1.6.0_20目录。
ok,jdk已安装完毕
2.2 方法2 之间通过更新安装
Debian 和 ubuntu 可以试试看下面方法:
How to download and install prebuilt OpenJDK packages
JDK 7
Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-7-jre
The openjdk-7-jre
package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk
package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c "yum install java-1.7.0-openjdk"
The java-1.7.0-openjdk
package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.7.0-openjdk-devel
package
安装后,java 的位置如下:
hsy@ubuntu:/usr/lib/jvm/java-7-openjdk-i386$
hsy@ubuntu:/usr/lib/jvm/java-7-openjdk-i386$ java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (7u51-2.4.4-0ubuntu0.13.04.2)
OpenJDK Client VM (build 24.45-b08, mixed mode, sharing)
2.3 方法3源码的安装
// 当然如果你是 JDK 的源码的话 你可以用官方的方法:
http://www.java.com/zh_CN/download/help/linux_install.xml
//如果你是UBUNTU的话,在UBUNT的网站上有对应的安装包
例如:
https://launchpad.net/ubuntu/+source/openjdk-7
root@ubuntu:/jdk# java -version
The program 'java' can be found in the following packages:
* gcj-4.4-jre-headless
* gcj-4.5-jre-headless
* openjdk-6-jre-headless
Try: apt-get install <selected package>
http://blog.sina.com.cn/s/blog_437ff56b0100tfi5.html
2.4 Ubuntu安装Sun JDK及如何设置默认java JDK
这样还不行 因为eclipse还找不到你的java,
你还需要做如下配置
1 然后配置环境变量~/.bashrc,在最后添加:
export JAVA_HOME=<jdk install dir>
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
例如:
3 建立软链接:
$ cd <eclipse dir>
$ ln -sf $JRE_HOME jre
目的是在eclipse安装目录下建立一个名称为jre的链接,将其指向java安装目录下的jre目录
再运行root@ubuntu:/eclipse/eclipse# ./eclipse
就可以顺利起来你要的eclipse的IDE界面了
3 CDT 的安装,
要支持C/C++的驱动开发 必须安装C.C++支持包,Eclips 用CDT插件进行安装:
ubuntu下CDT安装其实很简单,就是现在eclips网上下载对应的CDT包
https://www.eclipse.org/cdt/
或者直接从Eclips 的IDE里面的install newsoftware …里面输入连接下载地址
—————————————————————————————————————————————
ref:0
2012-08-23 23:43
Ubuntu 12.04 搭建 Eclipse Android 开发环境
http://hi.baidu.com/sf_chipan/item/e38ed5db1378666bdcf9be3f
ref: 1
http://blog.csdn.net/luyaowei/article/details/5608974
ref 2
http://blog.csdn.net/jokes000/article/details/7548437
ref 3 Ubuntu安装Sun JDK及如何设置默认java JDK
http://blog.sina.com.cn/s/blog_437ff56b0100tfi5.html
ref 4 JDK 7 最新版的配置详细 Ubuntu 12.04 64位编译android 4.1.1_r3
http://blog.csdn.net/yanzi1225627/article/details/7736364
ref 5 环境变量环境变量 etc 中 environment env profile 设置 及 区别
http://hi.baidu.com/shdren09/item/b10e5334faeac5d36c15e938
ref 6: 添加新的硬盘
http://www.2cto.com/os/201205/130771.html
本帖原创: by huang.makin@gmail.com