2013年10月18日 星期五

Ubuntu 12.04 Install JDK 6 for Android Source Code Builde

Install the Oracle JDK 6

http://askubuntu.com/questions/67909/how-do-i-install-oracles-jdk-6
Oracle themselves have the official guide to install their JDK - below is based upon those instructions.
  • Download the 32bit or 64bit Linux "compressed binary file" - it has a ".bin" file extension
  • Give it permissions to execute and extract it
    chmod a+x [version]-linux-i586.bin
    ./[version]-linux-i586.bin
During installation it will ask you to register - press ENTER. Firefox will open with the registration page. Registration is optional.
JDK 6 package is extracted into ./jdk1.6.0_x directory, for example ./jdk1.6.0_30.
Lets rename it:

JDK 6 
https://app.box.com/s/uar3raw5qh1w46bqnnnq

mv jdk1.6.0_30 java-6-oracle 
  • Now move the JDK 6 directory to /usr/lib
sudo mkdir /usr/lib/jvm
sudo mv java-6-oracle /usr/lib/jvm

switch to Oracle JDK 6

download

https://app.box.com/s/uuaac6svwnmn4bx2qwki

webupd8.googlecode.com hosts a nice-easy script to help with this.
wget http://webupd8.googlecode.com/files/update-java-0.5b chmod +x update-java-0.5b sudo ./update-java-0.5b 
don't worry - 0.5b refers to the script version - not the version of java!
An alternative to this is to use the webupd8 ppa and the update-java package.
enter image description here
Finally test the switch has been successful:
java -version javac -version 
These should display the oracle version installed - 1.6.0_30

Ubuntu GNU/Linux 12.04 LTS (Precise Pangolin) released. I wanted to manually install the Sun JDK 6 and 7 on Ubuntu.
Installing Sun JDK 6 on Ubuntu 12.04:
  • Make the bin file executeable:
chmod +x jdk-6u32-linux-x64.bin
  • Extract the bin file:
./jdk-6u32-linux-x64.bin
  • Move extracted folder to this location:
sudo mv jdk1.6.0_32 /usr/lib/jvm/
  • Install new java source in system:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
  • Choose default java:
sudo update-alternatives --config javac
sudo update-alternatives --config java
  • java version test:
java -version

----------------------------------
Installing Sun JDK 7 on Ubuntu 12.04:
  • Download the sun jdk 7 tar file from here
  • Extract the tar file:
tar -xvzf jdk-7u4-linux-x64.tar.gz
  • Move extracted folder to this location:
sudo mv jdk1.7.0_04 /usr/lib/jvm/
  • Install new java source in system:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_04/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_04/bin/java 1
  • Choose default java:
sudo update-alternatives --config javac
sudo update-alternatives --config java
  • java version test:
java -version

2013年4月14日 星期日

ASUS S200 WINDOWS 8 還原步驟


  1. 按電源按鍵開機
  2. 馬上按F9連續按
  3. 直到出現"重設你的電腦畫面"
  4. 選擇"限已安裝的WINDOWS 磁碟"
  5. OK

2013年3月12日 星期二

Linux套件更新指令APT & YUM


這裡必須註解的是,不是 Debain 只能用 apt,FC6 只能用 yum 喔,是系統內建。
APT 常用指令如下:
apt-get update更新套件列表
apt-get dist-upgrade升級 rpm
apt-cache search搜尋套件,ex: apt-cache search httpd
apt-get install安裝套件,這裡的套件安裝,會考慮到相依性的問題。 ex: apt-get install httpd 
apt-get remove
移除套件,這裡的套件移除,也會考慮到相依性的問題。 ex: apt-get remove httpd
apt-get clean清除安裝時下載的暫存套件原始檔案,位於 /var/cache/apt/archives
YUM 常用指令如下:
yum update更新套件, ex: yum update httpd,如果只有 yum update ,會更新所有已經安裝的套件。
yum search搜尋套件,ex: yum search httpd*,會搜尋所有跟 httpd 有關的套件。
yum install安裝套件,這裡的套件安裝,會考慮到相依性的問題。 ex: yum install httpd 
yum remove移除套件,這裡的套件移除,也會考慮到相依性的問題。 ex: yum remove httpd
yum clean清除安裝時下載的暫存套件原始檔案,位於 /var/cache/yum,因為這裡可以清除的項目很多,我最常用的是 yum clean all ,一次給他清掉 :p
yum list列出套件名稱,用法常用有分以下幾種:
yum list updates
列出所有可以更新的套件
yum list installed
列出所有已安裝的套件
更多的中文參考資訊,可以見以下兩個網站: