centOS5 ϵÄjava»·¾³ÅäÖÃ
µÚÒ»²½£º²é¿´Linux×Ô´øµÄJDKÊÇ·ñÒÑ°²×° £¨Ð¶ÔØcentOSÒÑ°²×°µÄ1.4£©
<1># rpm -qa|grep jdk ← ²é¿´jdkµÄÐÅÏ¢»òÖ±½ÓÖ´ÐÐ
»ò
# rpm -q jdk
»ò
# java -version
<2># rpm -qa | grep gcj ← È·ÈÏgcjµÄ°æ±¾ºÅ
<3># yum -y remove java-1.4.2-gcj-compat ← жÔØgcj
µÚ¶þ²½£º°²×°JDK
<1>´ÓSUNÏÂÔØjdk-1_5_0_14-linux-i586-rpm.bin»òjdk-1_5_0_14-linux-i586.bin
ÔÚ/usrÏÂн¨javaÎļþ¼Ð£¬½«°²×°°ü·ÅÔÚ/usr/javaĿ¼ÏÂ
# mkdir /usr/java
<2>°²×°JDK
# cd /usr/java
¢Ùjdk-1_5_0_14-linux-i586-rpm.binÎļþ°²×°
# chmod 777 jdk-1_5_0_14-linux-i586-rpm.bin ← ÐÞ¸ÄΪ¿ÉÖ´ÐÐ
# ./jdk-1_5_0_14-linux-i586-rpm.bin ← Ñ¡ÔñyesͬÒâÉÏÃæµÄÐÒé
# rpm -ivh jdk-1_5_0_14-linux-i586.rpm ← Ñ¡ÔñyesÖ±µ½°²×°Íê±Ï
¢Újdk-1_5_0_14-linux-i586.binÎļþ°²×°
# chmod a+x jdk-1_5_0_14-linux-i586.bin ← ʹµ±Ç°Óû§ÓµÓÐÖ´ÐÐȨÏÞ
# ./jdk-1_5_0_14-linux-i586.bin ← Ñ¡ÔñyesÖ±µ½°²×°Íê±Ï
µÚÈý²½£ºÅäÖû·¾³±äÁ¿
<1># vi /etc/profile
<2>ÔÚ×îºó¼ÓÈëÒÔϼ¸ÐУº
export JAVA_HOME=/usr/java/jdk1.6.0_10
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
<3># reboot ← ÖØÆô»úÆ÷ÅäÖÃÉúЧ
Ïà¹ØÎĵµ£º
ÎÒÔÚѧϰthinking in Java4 µÄʱºò£¬ÔÚ´´½¨×Ô¶¨Òå°üµÄʱºò£¬Åöµ½Á˺ܶà´íÎó£¬ÈÃÎÒÓôÃÆÁ˼¸Ì죬ͨ¹ýÔÚÍøÉϵÄ×ÊÁÏËÑË÷£¬°Ñ°üµÄ´´½¨¹ý³Ì¸ø´ó¼ÒÏêϸÁгöÀ´¡£
ÎÒÃÇÒÔthinking in Java4ÖеÄÀý×ÓΪÀý
´´½¨Á½¸öÀàVectorºÍList¡£½«±àÒëºóµÄVector.classºÍList.classÎļþ·ÅÔÚ°ünet.mindview.simpleÏÂ(¸Ã°üλÓÚc:\DOC\JavaT).
//Vec ......
Ò»¡£javaµÄÓÅÊÆ
1.ÃæÏò¶ÔÏó
2.¿çƽ̨
java×÷ΪһÖÖÍøÂçÓïÑÔ£¬ÆäÔ´´úÂë±»±àÒë³É.class×Ö½ÚÂ룬ÓÉjavaÐéÄâ»úÖ´ÐУ¬
3.¼òµ¥
Ò»£¬java·ç¸ñÀàËÆc++£¬c++³ÌÐòÔ±ÄܺܿìµØÕÆÎÕjava
¶þ£¬javaÞðÆúÁËÖ¸Õ룬½á¹¹£¬Ã¶¾ÙµÈÒ×Òý·¢ÄÚ´æÎÊÌâµÄ²Ù×÷
Èý£¬javaÌṩÁ˷ḻµÄapi£¬Äܹ»°ïÖúÎÒÃÇ¿ìËÙ¿ª·¢
4.½¡×³
Ò»¡£Ç¿ÀàÐ͵ģ¬ÀàÐͼì²éºÜÑ ......
ÔÚJavaÖз½·¨²ÎÊýµÄ´«µÝ£¬¶¼ÊÇÖµ´«µÝ£¬¶ÔÏó´«µÝÊǵØÖ· £¬»ù±¾Êý¾ÝÀàÐÍ´«µÝµÄÊÇÖµ¡£µØÖ·ºÍÖµ¶¼Öµ¡£
ÏÂÃæÒÔÒ»¸öÀý×ÓÀ´¿´ÄÚ´æÖеÄÊý¾Ý±ä»¯Çé¿ö
public class Test{
private String name;
public String getName(){
&nbs ......
´ó¼ÒºÃ£¬Çë°´ÕÕÏÂͼ¸ñʽÌîдÄãµÄ¼òÀú£¬·¢Ë͵½Óʼþ loveyingjiaping@126.com
¹«Ë¾×ܲ¿ÔÚº¼ÖÝÎ÷ºþ¿Æ¼¼Ô°¸½½ü£¬¸£Àû´ýÓöºÃ£¬ÎåÏÕÒ»½ð£¬
²¹Ìù£º·¹Ìù¡¢½»Í¨·Ñ¡¢Í¨Ñ¶·Ñ¡¢ÄêÖÕ½±¡¢¹ý½Ú·Ñ……
±±¾©·Ö¹«Ë¾¼¼Êõ²¿¾Àí£¨¸±¾Àí£©¸ÚλְÔðºÍÈÎÖ°Ìõ¼þÈçÏ£º
n ¸ÚλְÔð£º
1. & ......
Java¿ª·¢ÖУ¬×îÖյijÌÐò·¢²¼Ò»°ãÊÇÒª´ò³Éjar°üÐÎʽµÄ£¬¶øÓÐһЩÅäÖÃÎļþÊÇ·ÅÔÚjarÀïÃæµÄ£¬ÕâÑùÔÚ×öFileÐÎʽµÄ¶Áȡʱ£¬¾Í»á·¢ÏÖ¶Á²»µ½ÏàÓ¦µÄÎļþ¡£ÏÂÃæÌṩһÖÖ½â¾ö·½Ê½£ºString fileName = "/config/abcd.config";
InputStream in = getClass().getResourceAsStream(fileName);
BufferedReader br = null;
try{
br = n ......