标签:
2. 上载到Linux服务器上,在shell下执行命令:
[root@LinuxServer rpm]# chmod 755 j2sdk-1_4_2_06-linux-i586-rpm.bin [root@LinuxServer rpm]# ./j2sdk-1_4_2_06-linux-i586-rpm.bin |
Sun Microsystems, Inc. Binary Code License Agreement for the JAVATM 2 SOFTWARE DEVELOPMENT KIT (J2SDK), STANDARD EDITION, VERSION 1.4.2_X … Do you agree to the above license terms? [yes or no]yes Unpacking... Checksumming... 0 0 Extracting... UnZipSFX 5.40 of 28 November 1998, by Info-ZIP (Zip-Bugs@lists.wku.edu). inflating: j2sdk-1_4_2_06-linux-i586.rpm Done. |
[root@LinuxServer rpm]#rpm –ivh j2sdk-1_4_2_06-linux-i586.rpm Preparing... ########################################### [100%] 1:j2sdk ########################################### [100%] |
[root@LinuxServer rpm]# export JAVA_HOME=/usr/java/j2sdk1.4.2_06 [root@LinuxServer rpm]# export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar [root@LinuxServer rpm]# export PATH=$PATH:$JAVA_HOME/bin |
[root@LinuxServer rpm]#vi .bashrc set JAVA_HOME=/usr/java/j2sdk1.4.2_06 export JAVA_HOME set PATH=$PATH:$JAVA_HOME/bin export PATH set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export CLASSPATH |
[root@LinuxServer rpm]# echo $JAVA_HOME /usr/java/j2sdk1.4.2_06/ [root@LinuxServer rpm]# echo $CLASSPATH /usr/java/j2sdk1.4.2_06/lib/dt.jar:/usr/java/j2sdk1.4.2_06/lib/tools.jar [root@LinuxServer rpm]# echo $PATH /usr/java/j2sdk1.4.2_06/bin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin [root@LinuxServer rpm]# JAVA-version JAVA version "1.4.2_06" JAVA(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03) JAVA HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode) |
[root@LinuxServer rpm]#vi test.java class test { public static void main(String[] args) { System.out.println("Hello World!"); } } |
[root@LinuxServer text]# javac test.java [root@LinuxServer text]# JAVA test Hello World! |
[root@LinuxServer root]# vi /home/longware/.bashrc set JAVA_HOME=/usr/java/j2sdk1.4.2_06 export JAVA_HOME set PATH=$PATH:$JAVA_HOME/bin export PATH set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export CLASSPATH |
[root@LinuxServer rpm]# chmod a+x jdk-6u10-linux-i586-rpm.bin [root@LinuxServer rpm]# ./jdk-6u10-linux-i586-rpm.bin |
Sun Microsystems, Inc. Binary Code License Agreement for the JAVATM 2 SOFTWARE DEVELOPMENT KIT (J2SDK), STANDARD EDITION, VERSION 1.4.2_X … Do you agree to the above license terms? [yes or no]yes Unpacking... Checksumming... 0 0 Extracting... UnZipSFX 5.40 of 28 November 1998, by Info-ZIP (Zip-Bugs@lists.wku.edu). inflating: j2sdk-1_4_2_06-linux-i586.rpm Done. |
[root@LinuxServer rpm]#rpm –ivh jdk-6u10-linux-i586-rpm Preparing... ########################################### [100%] 1:j2sdk ########################################### [100%] |
标签:
原文地址:http://www.cnblogs.com/LxwEmbedded/p/4179430.html