Hudson install on Ubuntu hack

 

# Hudson install hack

# Install jdk6. Note: Now install jdk need new method. Please refer next page for detail.

sudo apt-get install sun-java6-jdk

裝好後,輸入命令

sudo update-alternatives --config java,然後從菜單裏選擇java-6-sun就可以了。

 

現在你可以輸入java -version來測試你的Jdk是否安裝好,怎麼樣,好了吧!

在我的機子上,只有java命令有效,其它的如javac,native2ascii等都找不到命令,說明默認只把java的鏈接添加到了$PATH中,這裏我們可以有兩種方法來解決。一是手動添加鏈接到/usr/bin目錄下,二是把$JAVA_HOME/bin添加到$PATH變量中。

這裏我採用第二種,使用你喜歡的編輯器,在~/.bashrc文件末尾加上以下兩行:

(More common setting in the /etc/profile)

export JAVA_HOME=/usr/lib/jvm/java-6-sun

export JRE_HOME=/usr/lib/jvm/java-6-sun/jre

export PATH=$PATH:$JAVA_HOME/bin

 

# Install Apache2, tomcat6, ant, subversion, etc

sudo apt-get install apache2

sudo apt-get install tomcat6

sudo apt-get install hudson

 

# Hudson can run in web by itself in install place /var/lib/hudson. But the more usual way is that sets the hudson in tomcat install place /var/lib/tomcat/webapps/hudson, which just need copy hudson.war to /var/lib/tomcat/webapps

# configures the HUDSON_HOME in /etc/default/tomcat6 file.

HUDSON_HOME=/var/lib/tomcat/webapps/Hudson

JAVA_OPTS=”-DHUDSON_HOME=/var/lib/tomcat/webapps/Hudson”

 

# some tomcat commands

sudo /etc/init.d/tomcat6 start

/etc/init.d/tomcat6 stop

/etc/init.d/tomcat6 restart

 

# Everything is ok, and you can configure the port number, such as 8082 instead 8080.

# should assign another port instead of defualt port 8080, such as 8082

java -jar hudson.war --httpPort=8082

 

# or change the /etc/default/hudson file

HTTP_PORT=8082

 

# In tomcat 6, you can configure file: /etc/tomcat6/server.xml for the port.

 

The sun-java6 package (and also jdk7) is no longer available in the official Ubuntu 11.10 Oneiric Ocelot repositories due to the removal of the JDL license. To install sun jdk on ubuntu 11.10.

1.Open Terminal.To open terminal click the Dash home from unity launcher. And type terminal in the search field. And click Terminal

2.Type the below code in terminal and hit enter.

sudo add-apt-repository ppa:ferramroberto/java

Type your ubuntu password if needed and press enter.

3.Then press enter to continue or ctrl-c to cancel adding the ppa.

4.Type below command and hit enter

sudo apt-get update

5.Then type below command and press enter

sudo apt-get install sun-java6-jdk sun-java6-plugin

6.Type y and hit enter to confirm the installation.

7.Select

OK

and press enter enter

8.To accecpt the DLJ licence select yes and press enter

9.After the successful installation,to check the installed version type

java -version

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章