在Ubuntu 13.10 搭建Python开发环境

在Ubuntu 13.10 搭建Python开发环境详解:

步骤一 安装JDK(为了安装ECLIPSE IDE)

解压缩安装包,并设置JDK。

update-alternatives --install选项的功能就是增加一组新的系统命令链接符。

tar -zxvf jdk-7u45-linux-x64.tar.gz
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.7.0_45 /usr/lib/jvm/jdk1.7.0
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

用update-alternatives --config命令,在现有的命令链接符中选择一个作为系统默认。

sudo update-alternatives --config java
sudo update-alternatives --config javac

比如,如果安装了多个JDK,就可以选择一个作为默认的:

$sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 3 manual mode

Press enter to keep the current choice[*], or type selection number: <SPAN style="COLOR: #ff0000">3</SPAN>
update-alternatives: using /usr/lib/jvm/jdk1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.

设置执行权限:

sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0

如果要安装Firefox plugin

mkdir ~/.mozilla/plugins
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
sudo /etc/init.d/apparmor restart

检查java安装是否成功

java -version

推荐阅读:

Python 的详细介绍:请点这里
Python 的下载地址:请点这里

相关推荐