DrJava
|
|||||||||||||
|
The programming environment used in CS100J is DrJava, a free "Integrated Development Environment" (IDE). DrJava will be used in class to demonstrate programming in Java. In addition, please download DrJava onto your computer and use it heavily in practicing programming in Java. DrJava was developed by Professor Corky Cartwright at Rice University. Both DrJava and Codewarrior are installed on CIT's computers. Please note that there are two versions of Java. The older version, Java 1.4.2, and the newer version, Java 1.5. For most of the semester, it will not matter which version you are using. We will not make use of the new features in Java 1.5.
You need a Java virtual machine You will need the Java software development kit (JDK) from the Sun website. THIS MAY ALREADY BE ON YOUR COMPUTER. Don't attempt to download and install it unless you know you don't have it. If you have a Macintosh running Mac OS X, you almost certainly have it. If you have a PC, this site can check whether you have it: If you need the Java software development kit (JDK) get it from this website: See the Popular Downloads link on the right side of that page. Choose J2SE 5.0. Also, choose the J2SE JDK or SDK (not just the JRE and not the "bundles" that include other programming environments, such as netBeans). Warning: this is a big download! If you cannot double-click on a jar file to start it running, or if
you cannot execute any of the commands java, javac, javadoc, or jar, you
probably have not set your path correctly. We explain this for Windows
2000; older windows systems are similar.
There should be a path that looks like this: C:\j2sdk1.4.1_02\bin. This
is a directory called bin inside the directory where you installed the
sdk. It may be different on your computer. If such a path is not there,
you have to add it. Bring up the help in your Windows system, open the
index, and look for "path". There, you will find instructions
on appending another directory to variable path. It may be something like
this (but read the instructions): The easiest thing for you to do is to download this zipped version of DrJava and unzip it: 2005aug14drjava.zip. Or, here is an unzipped version. This version is supposed to work whether you have Java 1.4.2 or Java 1.5, and we advise using it. If you want, open this web page (by clicking the link) in your browser and choose another version of DrJava to download. Get the latest version. Note that DrJava won't run unless you have a Java 2 v1.3 (or later) virtual machine already installed. Warning: you may get a dialog saying something about a "JAR archive security check". If you do, just right-click on the DrJava download link and select "Save Link As" (or the equivalent in your browser). We know that all this setup can be annoying, but you have to do it only once! A common DrJava problem: finding tools.jar Question: I downloaded Sun's J2SE SDK and DrJava. When it came to actually running DrJava, the following window kept popping up even though somehow DrJava still managed to run without me finding the file --what should I do?:
Answer: First, make sure you installed the Java SDK, not the JRE. (See above.) Next, file tool.jar comes with the JDK. The usual location is C:\Program Files\Java\jdk1.5.0_02\lib\tools.jar if you have followed the default options during the JDK download process. You can also use a desktop tool to search for this file on your computer. You simply need to set DrJava's Preferences to the correct path. To do so, follow these menu items: Edit - Preferences - Resource Locations - Tools.jar Location then type or browse to the correct location. There are several ways to run DrJava:
Documentation --how to use DrJava The demos given in class and in the demo sessions should help, if you take notes. Second, information on using DrJava is in Appendix I of the course text and in Chapter 19 Chapter 19 of the accompanying CD ProgramLive. Watch the ProgramLive lectures! They are short and informative. Third, here is documention on using DrJava on the web. Do you get a message that looks like this?
It may mean that your computer has two different systems on it and is an inconsistent state. If your computer has jre5.0, then it cannot use SDK 4.7. Uninstall SDK4.7 and download JDK 5.0 and use its tools.jar. |
|||||||||||||