1. Go to the website shown above.
The very best way to get the Java SDK is to go to the Java.Sun.com website. You can access it at http://java.sun.com/j2se/1.4.1/download.html
2. Download the SDK.
After you scroll down on the page, you’ll see two columns on the right (JRE and SDK). JRE stands for Java Runtime Environment. You would only need this if you planned to view applets in a browser and nothing more. Since you’re interested in writing Java programs, we’ll need the SDK. The SDK also includes the JRE.
3. If you like, fill out the information above for Sun. Submit the info or you can opt to not do this and still continue.
Here, Sun will want to you to offer some demographical information. If you want to do that, go ahead and then click “Yes, submit.” Otherwise, you can click the “No thank you” button.
4. Read the license and scroll to the bottom.
Here, you can read the legalese.
5. Click the Accept button.
If you feel you can live with the terms and conditions, go ahead and click the “Accept” button.
6. Click on the link to download the SDK.
7. Save the file to your computer.
Here you’ll be asked to Save or Open this file. Choose the Save option since you’ll be downloading the SDK to your hard drive.
8. Pick an easy to find folder like “Desktop.”
You can download this file anywhere you like. If you’re not too good with the file system, make sure you choose Desktop.
9. Downloading
10. Once its downloaded, look for the SDK setup file and double click it.
11. Files are extracting.
12. Click “Yes” that you agree to the agreement.
13. Install the SDK to the folder mentioned above.
14. Click Next.
15. Allow your internet browsers to be able use the Java Runtime Environment.
16. Installing
17. Click Finish.
Now, we’ll explore the SDK folder to see what it contains.
18. Double click on My Computer.
19. Enter the Systems drive (almost certainly, C: ).
20. Enter the SDK folder.
21. Enter the bin (binaries) folder.
22. These three applications are what you should be acquainted with at a minimum.
Above are the three executables you should familiarize yourself with. Appletviewer.exe is used to view Java applets without a web browser. Java.exe is used to run Java applications. Javac.exe is the command line compiler.
23. Go up.
24. Enter the “demo” folder.
In the demo folder are applets and applications. We’ll choose one in a minute and see how they run.
25. Enter the “applets” folder.
26. Enter the “clock” folder.
27. In your web browser, pull up “example1.html”.
Usually, most people on Microsoft Windows will have the file extensions hidden for files. This can be a hassle when we try to look for certain files like .java or .class. However, .html files are usually not hard to find. If your system is not configured to show the file extensions you can try Steps 28 – 30 to have this changed.
28. If for some reason you’re not able to read the file extensions (.html and the like), try the next few steps. Go to Folder Options…
29. Click the View tab.
30. Uncheck “Hide file extensions for known file types”. Click OK.
31. If you haven’t already, run the example1.html file in a web browser or double click it.
This is what a Java applet will look like in a web browser.
32. After viewing it, close the browser.
Now, we’re going to set your system’s path variables. If you’re using Windows 9.x or Linux, there are different ways to get this done. The example I will show will be for Windows NT, 2000, or XP.
33. Right-click on My Computer and select Properties on the shortcut menu.
34. Choose the Advanced tab.
35. Choose Environment Variables…
36. Scroll down with the vertical scrollbar on the right.
37. Scroll down to Path. With Path highlighted, click “Edit”.
38. In the Variable Value text box, add “;C:\j2sdk1.4.1_02”. Click OK.
If there is not semi-colon (;) at the end of the last entry in the Variable Value text box, make sure that a semi-colon is to the right of it. Add C:\j2sdk1.4.1._02 (or if you have a different version of the Java SDK, put that path in here).
39. Click OK.
That’s it. You should be able to use your Java compiler and all other command line tools. If you found this tutorial helpful, check out http://www.eztechbooks.com for free and low-cost technical books. We make easy to use, visual, step by step computer books for programming, power applications and operating systems.