Hudson install on Ubuntu hack

來源:互聯網
上載者:User

 

# 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

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.