顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

2015年7月14日 星期二

Install Java JDK on Ubuntu

Refernece:

http://www.dotblogs.com.tw/jhsiao/archive/2013/09/03/116186.aspx


Step1.首先到Oracle官網上下載,最新版的"jdk-7u25-linux-x64.tar.gz" or "jdk-7u25-linux-i586.tar.gz"
          (事先建立一個Downloads的資料夾,下載的東西都可放這裡面集中。)
Step2.將下載下來的JDK檔進行解壓縮,指令:tar -zxvf jdk-7u25-linux-i586.tar.gz
Step3.複製解壓縮後的資料夾jdk_1.7.0_25,到/usr/lib/jdk/目錄下面,指令:cp -r ~/Downloads/jdk1.7.0_25/ /usr/lib/jdk/
          (這裡如果沒有jdk資料夾,則建立該資料夾,指令:sudo mkdir /usr/lib/jdk)
Step4.設置環境變數,打開文件/etc/profile,指令:sudo vi /etc/profile
Step5.
在文件的最後端加上:
export JAVA_HOME=/usr/lib/jdk/jdk1.7.0_25 
export JRE_HOME=/usr/lib/jdk/jdk1.7.0_25/jre 
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
Step6.將系統默認的jdk修改過來,也就是java和javac指令由系統自帶的換成你自己安裝的
指令:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jdk/jdk1.7.0_25/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jdk/jdk1.7.0_25/bin/javac 300
sudo update-alternatives --config java
sudo update-alternatives --config javac
Step7.檢查版本,指令:java -version
如果出現以下字樣,代表順利完成安裝。
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Server VM (build 23.25-b01, mixed mode)

Installing Android Studio behind Proxy on Ubuntu

l操作步驟:

1. 進入 ${android-studio path}/bin
    Ex: ~/Program/android-studio/bin
2. 編輯  idea.properties
    vi idea.properties
    在檔案尾端加入下列這行並儲存檔案
     disable.android.first.run=true
3. 執行執行Studio
    ./Program/android-studio/bi/studio.sh
4. 進入進入Studio後 從跳出的視窗進行進行proxy設定
    Configure > Settings > Appearance & Behavior > System Settings > HTTP Proxy
5. 關閉Studio
6.  編輯 idea.properties 將步驟2加入的那行刪除並儲存
7.  重新啟動Studio
     

Reference:

http://mayneax.blogspot.tw/2015/01/installing-android-studio-behind-proxy.html


Navigate to the android-studio/bin directory

you need to edit  idea.properties script to skip the initial set up page

so run vi idea.properties
and add this line at the end of the script

disable.android.first.run=true

save the script and the run
 ./studio.sh

 On the window that appears go to Configure>System Settings>http proxy  then set your proxy.

Exit and then edit idea.properties file and remove the line you added, then run

./studio.sh

2015年7月1日 星期三

Enable/Disable SELinux by command

SELinux 可以使用setenforce 0/1來切換mode.
<Permissive mode>
$setenforce 0
<Enforcing mode>
$setenforce 1


SELinux 可以使用getenforce 0/1讀取mode.
Ex:
shell@hollyds:/ # getenforce
getenforce
Enforcing