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

 

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