ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂJDKµÄ°²×°

·¢²¼Ê±¼ä:2007-01-09 01:07:01À´Ô´:ºìÁª×÷Õß:swallow
1¡¢RPM in self-extracting file (j2sdk-1_4_2_04-linux-i586.bin, 32.77 MB) Õâ¸öÊÇ×Ô½âѹµÄÎļþ£¬ÔÚlinuxÉÏ°²×°ÈçÏ£º

# chmod u+x ./j2sdk-1_4_2_04-linux-i586.bin

# ./j2sdk-1_4_2_04-linux-i586.bin

ÔÚ°´ÌáʾÊäÈëyesºó£¬jdk±»½âѹµ½./j2sdk1.4.2_04Ŀ¼Ï¡£ÎªÓëÏÂÃæ2ÖÐJDK°²×°Â·¾¶Ò»Ö£¬ÎÒÃǽøÐÐÏÂÁвÙ×÷,ÔÚ/usr/javaϽ¨Á¢°²×°Â·¾¶£¬²¢½«Îļþ¿¼µ½¸Ã·¾¶Ï£º

# mkdir /usr/java

# cp -fr ./j2sdk1.4.2_04 /usr/java

2¡¢RPM in self-extracting file (j2sdk-1_4_2_04-linux-i586-rpm.bin, 32.77 MB)Õâ¸öÒ²ÊÇÒ»¸ö×Ô½âѹÎļþ£¬²»¹ý½âѹºóµÄÎļþÊÇj2sdk-1_4_2_04-linux-i586-rpm°ü£¬Ö´ÐÐrpmÃüÁî×°µ½linuxÉϾͿÉÒÔÁË¡£°²×°ÈçÏ£º

#chmod u+x ./j2sdk-1_4_2_04-linux-i586-rpm.bin

# ./j2sdk-1_4_2_04-linux-i586-rpm.bin

# rpm -ivh j2sdk-1_4_2_04-linux-i586-rpm

°²×°Èí¼þ»á½«JDK×Ô¶¯°²×°µ½ /usr/java/j2sdk1.4.2_04Ŀ¼Ï¡£

¶þ¡¢ÅäÖû·¾³±äÁ¿

1.ÐÞ¸ÄÓû§»·¾³±äÁ¿

¼ÙÉèʹÓÃjavaµÄÓû§Îª kunp£¬±à¼­¸ÃÓû§µÄ.bashrcÎļþ½øÐл·¾³±äÁ¿ÉèÖá£

# vi /home/kunp/.bashrc

ÔÚ .bashrcÎļþÖмÓÈ룺

export JAVA_HOME=/usr/java/j2sdk1.4.2_04
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin

2.ÐÞ¸ÄËùÓÐÓû§µÄ»·¾³±äÁ¿

# vi /etc/profile

ÔÚ¸ÃÎļþÖмÓÈë:

export JAVA_HOME=/usr/java/j2sdk1.4.2_04
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin

Ò»¶¨ÒªÔÚCLASSPATH·¾¶ÖмÓÈë$CLASSPATH:
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ