This document describes how to set up your Windows PC to run Java. It
also describes how to set up TextPad or BlueJ so that you can
write/compile/run Java using the tool.
Follow the instructions step-by-step, exactly in the order in which they are given.
First set your Window's "folder options" so that file extensions (such as .java, .class) are displayed (because they may not be shown by default). To show file extensions,
- From the Window's Start button, select "Control Panel".
- Then "Appearance and Themes".
- Then "Folder Options".
- In the pop-up window, under the "View" tab, in "Advanced Settings", unselect "Hide extensions for known file types" if it is selected. And click on "Apply" and "OK".
Then you will be able to see all file extensions when you browse your computer.
After installing Java, some computers don't recognize it -- the full version of Java. In which case, you need manually to "set the path to java" so that the system knows where to find Java.
After installing Java, it would probably be placed under a folder "C:\Program
Files\Java\jdk1.x.0_yy" where x is the JDK version and yy is the Update number.
You should first confirm the folder. To do so, one way is through Window's Explorer. You can open a Window's Explorer window by first clicking on the windows "Start" button, select "All Programs" and "Accessories", then "Window's explorer". Then navigate to the "Program Files" folder and expand it. Do the same under the "Java" subfolder. Then you'll see the subfolder named "jdk1.x.0_yy" (NOT jre...). Below is the screenshot of my computer, where the JDK version is 5 and the Update number is 08.
Now you set the path to this folder for your system, through Window's
I recommend doing ALL FOUR described below. At least you have to do the first two.
Click on the windows "Start" button and select "Control Panel" on the right column. Then select "Performance and Maintenance", and "System". In the pop-up window, select the "Advanced" tab, and click on "Environment Variables" button.
In the "User variables for Administrator", click on the line with PATH.
Then hit the "Edit" button. In the small pop-up window, put the cursor at the end of the line, and type in "; C:\Program Files\Java\jdk1.x.0_yy\bin" (with NO " "). Be sure to start with a semi-colon (;) and put your Java path. Hit OK.
After you are done with all of the above, re-start your computer.
0. Install TextPad. Be sure to do this AFTER Java is installed.
1. Start TextPad.
2. Under 'Configure' at the top menu, select 'Preferences'.
3. In the pop-up menu, expand 'Tools'.
4. In the sub-menu, select 'Compile Java'.
5. In 'Parameters' on the right pane, add in front of $File " -classpath . " --> so that the whole thing in the box looks like "-classpath . $File". Be sure to put a space before and after .
6. Click OK.
7. Do the same for 'Run Java Application' under the 'Tools' menu, that is, 'Configure' -> 'Tools' -> "Run Java Application', and in the right pane, make the 'Parameters' box look like "-classpath . $BaseName".
If TextPad doesn't work well on your computer, you may want to un-install TextPad once, and re-install -- maybe an older version (which I posted at http://facweb.cs.depaul.edu/noriko/Textpad/) works better than the latest one.
Based on what I've experienced, BlueJ doesn't seem to require any parameter setting after installation. Simply download and install the program, and you are set to go.