How to set up your computer for doing Java
If you're going to start developing your project in Java there's a couple of things you're going to need to do first:
- Install the Java 2 SDK and it's documentation.
- Install an IDE - this will make developing your project a lot easier.
- Make a few change to your computer setup so can run and compile stuff easily.
Downloading and Installing Java
To get the most recent version of the Java SDK go to the website and download Java 2 (JDK1.3) and it's documentation. You don't need to download the J2RE (Java 2 Runtime Environment) as it's already included in the Java 2 package.
Make sure you remove any earlier installations of the JDK - try Add/Remove programs from the Control Panel, or just delete the entire directory. Run the exe file for Java 2 and follow the prompts. Installing in the default directory 'c:\jdk1.3' is probably a good idea. Next you need to install all the docs stuff so double click on the documentation zip file. If you don't have winzip you can download it from www.winzip.com.
When winzip opens:
- Clear the text field beneath 'Extract to:'.
- Make sure 'All files' are selected and that 'Use folder names' is ticked.
- Click Extract.
When that's done Java 2 is fully installed. All that's left to do is set the paths for compiling and running Java.
Setting the Paths
- Click Start -> Run, type 'sysedit' and hit return.
- Go to the autoexec.bat file and add in these two lines.
- PATH c:\windows;c:\windows\command;c:\dos;c:\jdk1.3\bin
Note: Your PATH won't necessarily be the same as this one, but it should have at least this much in it. If your PATH contained other stuff, don't delete it, just make sure you add the ;c:\jdk1.3\bin at the end
- set CLASSPATH=.
- Click File -> Save and close the window.
That's what Sun recommends you do but just in case you get errors about finding classes or something change the classpath so it reads like this instead.
set CLASSPATH=c:\jdk1.3\jre\lib\rt.jar;
Fire up your computer again (reboot) and you're away.
If you're running from the command line use:
- 'javac whatever.java' to compile
- 'java whatever' to run an application
- 'appletviewer whatever.html' to run an applet
One last thing, if you're compiling/running from DOS, type 'doskey' so you can use the Up and Down arrows to scroll through your command history.
Running an App
Menu
Last updated August 15th 2000 |