New to Java? We'll help you get started with our revised beginner's tutorial, or our free online textbook.
|
Get the latest Java books |
|
h t t p : / /w w w . j a v a c o f f e e b r e a k . c
o m /
|
Menu Articles Using Java Applets Looking for Java resources? Check out the Java Coffee Break directory! |
Getting started with Java"A beginner's guide to Java programming"Setting up environmental variables for JDKUnder Windows, you set environmental variables by modifying the autoexec.bat file, located in the root directory of your hard-drive. This batch file is executed on startup; modifications to this file will not take effect until you run it, or reboot.
Modifying autoexec.batYou'll need to edit the autoexec.bat file with a simple text editor.
Open it up, and add a path statement pointing to the /bin/ directory
under your JDK installation directory.
For example, if I'd installed my JDK to c:\jdk1.3\, I'd want to point the path statement to c:\jdk1.3\bin\. However, you must also be careful not to overwrite existing path statements set for other software packages. To prevent this, use the following statement (modifying directory for your installation location) set path=%path%;c:\jdk1.3\bin\ Next, you need to set the classpath to include the current directory. The classpath helps JDK locate Java software (class files) that are installed on your machine. Some versions of JDK don't require this, but some of the tools that ship with JDK do require it, so it's best to set this environmental variable up properly. set classpath=%classpath%;.\
That done, reboot and you'll be ready to start writing your first Java application.
|
||||||
|