Ubuntu10.04安装Eclipse及Pydev

首先到eclipse.org官网 下载linux版eclipse.下载后解压缩安装到/opt目录。

sudo tar xvzf eclipse-java-helios-SR1-linux-gtk.tar.gz -C /opt


刺此刻启动eclipse,系统会提示缺少Java运行环境。需要安装java虚拟机。由于ubuntu10.04已经取消了sun-java6-jdk 和 sun-java6-jre的软件包,所以这里我们需要手动安装:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts


安装过程中会弹出一个蓝底的界面。鼠标不能用,请用键盘上的 TAB 键跳转,用回车键确认。接受许可协议后安装会自动执行完。最后在终端输入java命令测试安装结果。
接下来启动Eclipse,打开Help->Install New Software,在work with中填入pydev的下载地址以增加Pydev站点:

Ubuntu10.04安装Eclipse及Pydev


注意这里只选择pydev for eclipse,否则安装会提示“

Cannot complete the install because one or more required items could not be found.
Software being installed: PyDev Django Templates Editor 1.6.2.2010090812
Cannot complete the install because one or more required items could not be found.  Software being installed: PyDev Django Templates Editor 1.6.2.2010090812”的错误。

选择之后一路Next就可以了。自后重启Eclipse.

最后一步开始配置python。打开windows->preferences在左侧找到pydev项,然后点击打开interpreter python,新增编译器,名字可自定义为:pythoninterpreter,路径为:usr/bin/python2.6,确定即可。

新建pydev project,代码简单如下:
''' Created on Sep 30, 2010   @author: leyond '''def hello():     print "Hello world"  if __name__  ==  "__main__":     hello()

如果能看到 “hello world”,大功告成。

-
  笔者转载自:http://www.leyond.info/eclipse-and-pydev-installed-on-ubuntu/

你可能感兴趣的:(java,eclipse,linux,django,python)