Installing the SDK

     

First you have to get it. Visit http://java.sun.com/j2se/1.5.0/download.jsp.

Accept the license agreement and download the SDK. Make sure that as you follow the instructions below, you change the file names as necessary for the exact distribution you get.

On Windows

Just run the executable installer.

Open a command prompt. If you can type "java -version" and see something meaningful, you're good to go.

If not, read on.

On Linux

Get the RPM binary for Linux. You have to give the j2sdk* file permission to execute.

 

 $ chmod a+x j2sdk-1_5_0-linux-i586-rpm.bin 

Now execute the file.

 

 $ ./j2sdk-1_5_0-linux-i586-rpm.bin 

Agree to the license.

Change to super user :

 

 $su root Password: ****** 

To install it if a previous version of Java is not already installed, type

 

 $rpm -iv j2sdk-1_5_0-fcs-linux-i586-rpm 

If Java is already installed and you are updating to the new version, type

 

 rpm -Uv j2sdk-1_5_0-fcs-linux-i586-rpm 

Ensure that everything went all right by typing

 

 /usr/java/j2sdk1.5.0/bin/java -version" 

This executes the java program, passing it the "-version" flag. If all has gone well, you will see version information indicating that you are running Java 5.0 or Java 1.5.0.

Now you will need to set your path and classpath.

graphics/fridge_icon.jpg

FRIDGE

You might need to set your path and your classpath before you are able to compile, especially if you aren't writing your code in an IDE. See "Setting the Classpath" in this chapter for details on how to do that.


This section covers how to compile Java source code using the tools distributed with the Sun J2SE 5.0 (a.k.a. 1.5).



Java Garage
Java Garage
ISBN: 0321246233
EAN: 2147483647
Year: 2006
Pages: 228
Authors: Eben Hewitt

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