LinuxÏÂJdkµÄ°²×°ºÍJava»·¾³±äÁ¿µÄÉèÖÃ
ÔÚlinuxÏ°²×°JDKÈçÏ£º
µÚÒ»²½£º²é¿´Linux×Ô´øµÄJDKÊÇ·ñÒÑ°²×°
£¨1£©²é¿´ÒѾ°²×°µÄjdk£º
# rpm -qa|grep jdk ← ²é¿´jdkµÄÐÅÏ¢»òÖ±½ÓÖ´ÐÐ
»ò
# rpm -q jdk
»ò
# java -version
£¨2£©rpm -qa|grep jdk жÔØ£º
£¨3£©rpm -e rpm°üÃû£¨ÉÏÃæ¿´µ½µÄ£©Èô´æÔÚÒÀÀµ¹Øϵ£¬ÏÈжÔØÉϲãµÄ¡£
µÚ¶þ²½£º°²×°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£¨mkdir java –´ËĿ¼ÐèÒª´´½¨£©
¢Ùjdk-1_5_0_16-linux-i586-rpm.binÎļþ°²×°
# chmod 777 jdk-1_5_0_16-linux-i586-rpm.bin ← ÐÞ¸ÄΪ¿ÉÖ´ÐÐ
# ./jdk-1_5_0_16-linux-i586-rpm.bin ← Ñ¡ÔñyesͬÒâÉÏÃæµÄÐÒé
# rpm -ivh jdk-1_5_0_16-linux-i586.rpm ← Ñ¡ÔñyesÖ±µ½°²×°Íê±Ï
¢Újdk-1_5_0_16-linux-i586.binÎļþ°²×°
# chmod a+x jdk-1_5_0_16-linux-i586.bin ← ʹµ±Ç°Óû§ÓµÓÐÖ´ÐÐȨÏÞ
# ./jdk-1_5_0_16-linux-i586.bin ← Ñ¡ÔñyesÖ±µ½°²×°Íê±Ï
µÚÈý²½£ºÅäÖû·¾³±äÁ¿
<1># vi /etc/profile
<2>ÔÚ×îºó¼ÓÈëÒÔϼ¸ÐУº
export JAVA_HOME=/usr/java/jdk1.5.0_16
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># source /etc/profile Ö´ÐкóÉúЧ
µÚËIJ½£º²âÊÔJDK
#vi hello.java
public class hello {
public static void main(String args [ ])
{
System.out.println("Hello World!");
System.out.println("2009/2/19");
}
}
# javac hello.java
# java hello
Hello World!
2009/2/19
¿´µ½ÕâЩ¾Í´ú±í°²×°³É¹¦ÁË!
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/candle806/archive/2009/05/14/4187017.aspx
Ïà¹ØÎĵµ£º
°²×°Java¿ª·¢Èí¼þʱ£¬Ä¬ÈÏ°²×°°üº¬Á½¸öÎļþ¼Ð£¬Ò»¸öJDK(Java¿ª·¢¹¤¾ßÏä)£¬Ò»¸öJRE(JavaÔËÐл·¾³£¬ÄÚº¬JVM)£¬ÆäÖÐJDKÄÚÁíº¬Ò»¸öJRE¡£Èç¹ûÖ»ÊÇÔËÐÐJava³ÌÐò£¬ÔòJREÒÑ×ã¹»£»¶øJDKÔòÖ»Óпª·¢ÈËÔ±²ÅÓõ½¡£
Ò»¡¢JVMÄÚ´æ·ÖÅäÉèÖÃ
1. JVMÄÚ´æ·ÖÅäÉèÖõIJÎÊýÓÐËĸö£º
-Xmx Java Heap×î´óÖµ£¬Ä¬ÈÏֵΪÎïÀíÄÚ´æµÄ ......
ÔÚJava AplicationÖÐʵÏֵļòÒײ¥·ÅÆ÷¡£À´Ô´ÓÚºúÇɶàÖ÷±àµÄ¡¶Java³ÌÐòÉè¼Æ°¸Àý½Ì³Ì¡·
ÎÒÊÔÔËÐйýÁË£¬ÆäÖÐµÄ “Ìýº£.wav”,“Ò»¶¨Òª°®Äã.wav”ÒôƵÎļþÒª·ÅÔÚclassËùÔÚµÄÎļþ¼ÐÖУ¬ÇÒÖ»Ö§³Öwav¸ñʽ
Ô´´úÂ룺
import java.applet.Applet;
import java.applet.AudioClip;
import javax.swing.* ......
µÚ5ÕÂͼÐνçÃæÉè¼Æ(Ò»)
(Ò»)¿Î³ÌÄÚÈÝ
5.1 ͼÐνçÃæÉè¼Æ»ù´¡
5.1.1 AWI’ºÍSwing
5.1.2×é¼þºÍÈÝÆ÷
5.1.3ʼþÇý¶¯³ÌÐòÉè¼Æ»ù´¡
5.2¿ò¼Ü´°¿Ú .
5.3±êÇ©¡¢°´Å¥ºÍ°´Å¥Ê¼þ
5.3.1 ±êÇ©
5.3.2°´Å¥ºÍ°´Å¥Ê¼þ´¦Àí
5.4Ãæ°å
5.4.1 JPanel
5.4.2 JScrollPane
5.5²¼¾ÖÉè¼Æ
5.5.1 FlowI.ayout²¼¾Ö
5.5.2 BorderI.a ......
µÚ8Õ ¶àÏß³Ì
(Ò»)¿Î³ÌÄÚÈÝ
8.1Ï̵߳Ļù±¾¸ÅÄî
8.1.1Ï̵߳ÄÉúÃüÖÜÆÚ
8.1.2Ï̵߳÷¶ÈÓëÓÅÏȼ¶
8.2 ThreadÀàºÍRunnable½Ó13
8.2.1 ThreadÀà
8.2.2 Runnable½Ó¿Ú
8.3Ï̻߳¥³âºÍͬ²½
8.3.1Ï̻߳¥³â
8.3.2Ïß³Ìͬ²½
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉܶàÏ̵߳ĸÅÄîºÍ±àд¶àÏ̳߳ÌÐòµÄ·½·¨£¬ÊµÏÖÏß³ÌÖ®¼äÏ໥ͨÐźÍͬ²½µÄ¼¼ ......
µÚ10Õ ÍøÂçÓëÊý¾Ý¿â±à³Ì»ù´¡
(Ò»)¿Î³ÌÄÚÈÝ
10.1 JavaÍøÂç±à³Ì»ù´¡
10.1.1 IPµØÖ·ºÍInetAddressÀà
10.1.2ͳһ×ÊÔ´¶¨Î»·ûURL
10.1.3¿Í»§»ú/·þÎñÆ÷ģʽ
l0.2 JavaÊý¾Ý¿â±à³Ì»ù´¡
10.2.1 Java³ÌÐòÓëÊý¾Ý¿âÁ¬½Ó
10.2.2¼¸¸öÖØÒªµÄÀàºÍ½Ó¿Ú
10.2.3Êý¾Ý¿â²éѯ
10.2.4Êý¾Ý¿â¸üÐÂ
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉÜJavaÍøÂç± ......