Installing JDK Under Linux

I l @ ve RuBoard

Installing the JDK under Linux requires similar steps, but because Linux is such a different creature, you'll do them in very different ways than Windows requires.

Getting the Binary Distribution

Point your browser to http://java.sun.com/j2se/1.3/download-linux.html and click Continue under Red Hat RPM Shell.

Accept the license agreement, and choose a server to download from. Save the file in the /tmp/ directory.

Installing the Distribution

As root, cd to /tmp and type ./j2sdk-1_3_1_01-linux-i386-rpm.bin. Agree to the license by entering yes. This creates a file called jdk-1.3.1_01.i386.rpm in /tmp. Install it using rpm:

 [root@linux tmp]# rpm install jdk-1.3.1_01.i386.rpm 

This unpacks the distribution as /usr/java/jdk1.3.1_01.

Setting JAVA_HOME and PATH

Create the file /etc/profile.d/jdk.sh as root with the following content:

 PATH="$PATH:/usr/java/jdk1.3.1_01/bin" JAVA_HOME=/usr/java/jdk1.3.1_01/ export JAVA_HOME PATH 

As root, issue the following command:

 chmod a+x /etc/profile.d/jdk.sh 

Testing the Linux JDK Installation

Log out and log back in again; then type java. You should see the following:

 [turner@linux turner]$ java Usage: java [-options] class [args...]            (to execute a class)    or  java -jar [-options] jarfile [args...]            (to execute a jar file) where options include:     -client       to select the "client" VM     -hotspot      is a synonym for the "hotspot" VM  [deprecated]     -server       to select the "server" VM     -classic      to select the "classic" VM                   If present, the option to select the VM must be first.                   The default VM is -client.     -cp -classpath <directories and zip/jar files separated by :>                   set search path for application classes and resources     -D<name>=<value>                   set a system property     -verbose[:classgcjni]                   enable verbose output     -version      print product version and exit     -showversion  print product version and continue     -? -help      print this help message     -X            print help on non-standard options 

If you don't get this output, do echo $PATH and make sure that the /usr/java/jdk1.3.1/bin directory is part of your path. If it is not, you should recheck the step in which you set up PATH .

I l @ ve RuBoard


MySQL and JSP Web Applications. Data-Driven Programming Using Tomcat and MySQL
MySQL and JSP Web Applications: Data-Driven Programming Using Tomcat and MySQL
ISBN: 0672323095
EAN: 2147483647
Year: 2002
Pages: 203
Authors: James Turner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net