Installing JDK Under Windows

I l @ ve RuBoard

Installing JDK Under Windows

The Java Developer Kit (JDK) is also sometimes known as the Java SDK (for Software Development Kit). In short, the JDK is the Java base ”everything else you'll do is built on it. The JDK contains the Java compiler, the runtime interpreter, the libraries, and other assorted items needed to compile and run Java.

The JDK shouldn't be confused with the JRE, the Java Runtime Environment, which allows a user to run Java code that already has been compiled, but not to actually compile new code.

Getting the Binary Distribution

Begin at Sun's Web site, http://java.sun.com/j2se/1.3/download-windows.html. This will bring you to the Java for Windows page. Find and click the Download button for the Java 2 SDK.

This will take you to a licensing page. Read through the license agreement. If you agree, click Accept at the bottom of the page. This will take you to a page where you can select a site to download the distribution.

Choose whichever one fits your fancy (or seems to run the fastest ), and save the file j2sdk-1_3_1_01-win.exe to a location that you'll be able to find later ”the desktop or the My Documents folder are good choices.

Unpacking the JDK Distribution

When the file download is complete, you might be given the option to open it, depending on the browser you've used. If so, open the file. Otherwise, use a file explorer to view the directory where you've saved the file, and double-click it.

When the installer starts running, click Next on the first screen and the license agreement, which will bring you to the screen labeled Choose Destination Location.

You can pick any location you like, but the default (which is C:\jdk1.3.1_01) is fine.

Next, you're asked to choose the components to install. Select everything but Java Sources; if you have enough disk space, you can select it as well.

Clicking Next causes the installer to run, unpacking the application as requested .

Configuring JAVA_HOME and PATH

To complete the installation, you need to configure two environment variables : JAVA_HOME and PATH . This is done differently depending on whether you're running Windows 95 or 98 or Windows NT, 2000, or XP.

Windows 95 or 98

From the Windows taskbar, click Start, Run. Then type in notepad c:\autoexec.bat.

Add the following lines to the bottom of the file:

 SET PATH=%PATH%;C:\JDK1.3.1_01\BIN SET JAVA_HOME=C:\JDK1.3.1_01 

Save the file and reboot.

Windows NT, 2000, or XP

Open the control panel and double-click System.

Click the Advanced Tab and then the button marked Environment Variables. Then click the button marked New under the System Variables section. When the New Variable window opens, type in JAVA_HOME for the variable name and C:\JDK1.3.1_01 for the value ( assuming that this is where you installed the JDK).

Click the PATH variable in the scrolling window under System Variables, and then click Edit. Go to the end of the variable value box and add ;C:\JDK1.3.1_01\bin .

Save the changes to your environment variables by selecting the OK button, and close the Control Panel.

Testing the Windows JDK Installation

To test the installation, open a command window (Start, Program Files, Accessories, Command Prompt), and type java at the command line. You should see this:

 C:\Documents and Settings\james>java Usage: java [-options] class [args...]            (to execute a class)    or  java -jar [-options] jarfile [args...]            (to execute a jar file) where options include:     -hotspot      to select the "hotspot" VM     -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 -hotspot.     -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 see this output ( specifically , if you see a message about not finding the command), type echo %PATH%. You should see your JDK directory somewhere in the string that is printed. If you don't, recheck the steps to set the PATH variable.

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