LinuxÅäÖÃjava¿ª·¢Æ½Ì¨
LinuxÅäÖÃjava¿ª·¢Æ½Ì¨
Ò»¡¢°²×°jdk
1.ÏÂÔØ°²×°jdk
£¨1£©¡¢Ê×ÏÈ£¬ÔÚhttp://java.sun.com
ÕÒµ½ÒªÏÂÔصÄjdk£¬ÏÂÔØ×Ô¼ºÐèÒªµÄjdk°æ±¾¡£ÎÒÕâÀïʹÓõÄÊÇjdk6£¬µÃµ½µÄÊÇÒ»¸öÃûΪjdk-6u6-linux-i586-rpm.binµÄÎļþ¡£´ËÎļþµ±Ç°Îª²»¿ÉÔËÐеÄshell script¡£
£¨2£©¡¢¸ü¸ÄȨÏÞ£¬ÌáÈ¡jdk°²×°Îļþ£º
´ò¿ªÖÕ¶ËÔËÐУº#chmod a+x jdk-6u6-linux-i586-rpm.bin
# ./ jdk-6u6-linux-i586-rpm.bin
ÔÚ°´ÌáʾÊäÈëyesºó£¬jdk±»½âѹµ½./j2sdk1.4.2_04Ŀ¼Ï¡£
£¨3£©¡¢½¨Á¢java°²×°Â·¾¶ £º
# mkdir /usr/java
£¨4£©¡¢°²×°Îļþ
# rpm -ivh jdk-6u6-linux-i586-rpm
°²×°Èí¼þ»á½«JDK×Ô¶¯°²×°µ½/usr/java/Ŀ¼Ï¡£
2¡¢ÅäÖû·¾³±äÁ¿
£¨1£©¡¢´ò¿ªÎļþ£º# vi /etc/profile
ÔÚÎļþÖмÓÈ룺
export JAVA_HOME=/usr/java/ jdk1.6.0_06
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
£¨2£©ÖØÐÂ×¢Ïúһϣ¬È»ºó´ò¿ªÖÕ¶ËÊäÈ룺# echo $JAVA_HOME
# javac
# java
#java –version
³öÏֵİ汾ÐÅÏ¢¾ÍÊÇÕýÈ·µÄ¡£
´ËʱÎÒÃÇ¿ÉÒÔд¸öhelloworld²âÊÔÏÂjdkÊÇ·ñ°²×°ºÃ£¡
# vi HelloWord.java
¶þ¡¢ÔÚlinuxƽ̨ÉÏ°²×°Tomcat
ÏÂÔØ£ºhttp://apache.mirror.phpchina.com/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.tar.gz
£¨¿
Ïà¹ØÎĵµ£º
Ç°¶Îʱ¼ä¹«Ë¾¿ªÊ¼ÓÃSSH¿ò¼Ü£¬ÒòΪÒÔǰûÓÐÓùý£¬Ï¸ö¼¸¸ödemo¿´¿´£¬·¢ÏÖÏëÀí½âStructs2µÄÁ÷³ÌÕæÊÇÀ§ÄÑ£»ºóÀ´ÓÖÏëÕûºÏExt½øÐнçÃ濪·¢£¬ÉÏÍøÕÒ×ÊÁÏ£¬·¢ÏÖÓÃStructsÕûºÏAjax»¹ÕæÊÇÂé·³£¬²»½öǰ̨Ҫ×öÐ޸ģ¬ºǫ́»¹Òª¸ÄÅäÖÃÎļþÒÔ¼°actionÀ࣬Õæ²»ÖªµÀÕâÑùµÄ¶«Î÷×öÍêÁ˸ÃÔõôÑùȥά»¤£¡¼ÌÐøÔÚÍøÉÏÕÒÖÕÓÚ±»ÎÒ·¢ÏÖÁËVraptor£¬¸Ã¿ò ......
import java.io.*;
/**
* linux ÏÂcpu ÄÚ´æ ´ÅÅÌ jvmµÄʹÓüà¿Ø
* @author avery_leo
*
*/
public class TT {
/**
* »ñÈ¡cpuʹÓÃÇé¿ö
* @return
&nbs ......
JavaµÄÄÚ´æÄ£ÐÍJMM£¨Java Memory Model£©JMMÖ÷ÒªÊÇΪÁ˹涨ÁËÏ̺߳ÍÄÚ´æÖ®¼äµÄһЩ¹Øϵ¡£¸ù¾ÝJMMµÄÉè¼Æ£¬ÏµÍ³´æÔÚÒ»¸öÖ÷ÄÚ´æ(Main Memory)£¬JavaÖÐËùÓÐʵÀý±äÁ¿¶¼´¢´æÔÚÖ÷´æÖУ¬¶ÔÓÚËùÓÐÏ̶߳¼Êǹ²ÏíµÄ¡£Ã¿ÌõÏ̶߳¼ÓÐ×Ô¼ºµÄ¹¤×÷ÄÚ´æ(Working Memory)£¬¹¤×÷ÄÚ´æÓÉ»º´æºÍ¶ÑÕ»Á½²¿·Ö×é³É£¬»º´æÖб£´æµÄÊÇÖ÷´æÖбäÁ¿µÄ¿½±´£¬»º´ ......
·´Éä»úÖÆ:ËùνµÄ·´Éä»úÖƾÍÊÇjavaÓïÑÔÔÚÔËÐÐʱӵÓÐÒ»Ïî×Ô¹ÛµÄÄÜÁ¦¡£Í¨¹ýÕâÖÖÄÜÁ¦¿ÉÒÔ³¹µ×µÄÁ˽â×ÔÉíµÄÇé¿öΪÏÂÒ»²½µÄ¶¯×÷×ö×¼±¸¡£ÏÂÃæ¾ßÌå½éÉÜÒ»ÏÂjava
µÄ·´Éä»úÖÆ¡£ÕâÀïÄ㽫µß¸²ÔÀ´¶ÔjavaµÄÀí½â¡£
JavaµÄ·´Éä»úÖƵÄʵÏÖÒª½èÖúÓÚ4¸öÀࣺclass£¬Constructor£¬F ......
cd /usr/lib/jvm/java
-1.5.0-sun-1.5.0.15/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo cp /usr/share/fonts/truetype/arphic/uming.ttc /usr/lib/jvm/java
-1.5.0-sun-1.5.0.15/jre/lib/fonts/fallback
sudo mkfontdir
sudo mkfontscale ......