SmileFace
與java一起走過的日子 |
tar -xzf apache-ant-1.7.1-bin.tar.gz3. create a symbolic link for Ant so other applications can easily find it. Be sure to select the correct version when you create your link.
2. install tomcat:(note: download and put the tar file in /usr/share first )
tar -xzf apache-tomcat-6.0.18.tar.gz
ln -s /usr/share/apache-ant-1.7.1/bin/ant /usr/bin4. set JAVA_HOME:
cd /usr/share/apache-tomcat-6.0.18/bin
vi catalina.sh
enter insert mode. Enter the following:
JAVA_HOME=/usr/java/jdk1.6.0_14Test:
cd /usr/share/apache-tomcat-6.0.18/bin5.Automating atartup: Right now Tomcat will not start up on it's own so we need to create a startup script for this. To do this:
./startup.sh
cd /etc/init.d
vi tomcat
Press i to enter insert mode and paste in the following:
#!/bin/bash
# chkconfig: 234 20 80
# description: Tomcat Server basic start/shutdown script
# processname: tomcat
JAVA_HOME=/usr/java/jdk1.6.0_14
export JAVA_HOME
TOMCAT_HOME=/usr/share/apache-tomcat-6.0.18/bin
START_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/startup.sh
STOP_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/shutdown.sh
start() {
echo -n "Starting tomcat: "
cd $TOMCAT_HOME
${START_TOMCAT}
echo "done."
}
stop() {
echo -n "Shutting down tomcat: "
cd $TOMCAT_HOME
${STOP_TOMCAT}
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
Be sure to change the following items in the above file:
* JAVA_HOME path
* TOMCAT_HOME path
* START_TOMCAT path
* STOP_TOMCAT path
Once you have those changes made, save the file and quit.
Now we need to change the permissions on the file.
chmod 755 tomcat
We need to set the script to start with other system services and set the runlevels.
chkconfig --add tomcat
chkconfig --level 234 tomcat on
You can verify that it is listed by typing chkconfig --list tomcat.
tomcat 0:off 1:off 2:on 3:on 4:on 5:off 6:off
Test your shutdown and startup script.
sudo /sbin/service tomcat stop
sudo /sbin/service tomcat start
Tomcat 6 should now be installed under CentOS.
$yum install java-1.6.0-openjdk-devel*location: /usr/lib/jvm...
You can also install all the OpenJDK 6 packages, including the API documentation, by using the wildcard java-1.6.0-openjdk*.
最近賦閑,借來這本書看。本來希望很大,期冀可以學到些東西。結果,事與愿違。
總的感覺:這書一般,不推薦給大家,尤其是對于有項目開發經驗的人。在這個200多頁的書里,作者羅列了項目開發方法,開發工具,開發環境等等。因為涉及內容太多,所以每個知識點都是一帶而過,不過講講優點,缺點。所以感覺四不像。
如果你是個沒有項目開發經驗的人,想全面地了解目前web開發的基本過程,項目可能涉及的技術方面,可以看看。
下面是自己的一些讀書筆記,你們可以掠過:
1.Agile model driven development(AMDD): focus on model
2.Extreme programmning: focus on full development life cycle.
3.Jconsole: c:\program files\java\jdk1.6.0_14\bin\jconsole, which could dectect the memory issue, class loading,
garbage collection...
Java profilers: analyze the heap for memory usage and leaks, CPU utilization, trace object and methods,determine performance bottlenecks...
4.Ant new feature:
<exec command="date"/>
Get: fetch a file using HTTP GET.
<get src="http://visualpatterns.com/comics/funny.gif" dest="funny.gif" verbose="true"/>
Sleep: pause processing.
<sleep seconds="2"/>
FTP: use FTP directly. The example transfe the files to ftp server automatically using windows scheduled tasks
<ftp server="mirror.kernel.org"
action="get"
remotedir=...> </ftp>
MAIL: ...
5. JMX: my thought: I can use it to track how many user signed into, and so on.
6.unchecked exception: do not need to be caught by the code. Checked exception require the code to either cathch the exception or throw it up the call chain using throws. "If a client can reasonble to recover from an exception, make it a checked exception. If client cannot do anything to recover from the excepetion, make it unchecked"
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 | 1 | |||
2 | 3 | 4 | 5 | 6 | 7 | 8 |