在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 >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開發技術詳解》.( 周偉,宗傑).[高清PDF掃描版+隨書視頻+代碼] http://www.linuxidc.com/Linux/2013-11/92693.htm
Python腳本獲取Linux系統信息 http://www.linuxidc.com/Linux/2013-08/88531.htm
Ubuntu 12.04下用Eclipse搭建Python集成開發環境 http://www.linuxidc.com/Linux/2012-06/61649.htm
Python 的詳細介紹:請點這裡
Python 的下載地址:請點這裡