This page is obsolete.
To use our standard library files (StdDraw.java, StdIn.java, and StdOut.java), you can place them in the same directory as the main program you are writing. A drawback with this is approach is that you end up with many copies of the same library files, scattered in different directories. Java's classpath mechanism allows you to store and access the library files from a common directory.
|Organizing the Shared Libraries|
Place the shared library files (StdDraw.java, StdIn.java, and StdOut.java) in a commond directory, say C:\introcs. Go to that directory and compile them.
|Setting the Classpath in DrJava|
To set the classpath for DrJava:
|Setting the Classpath for the Windows Command Prompt|
To set the classpath for the Windows XP Command Prompt:
|Setting the Classpath in OS X|
To set the classpath for the bash shell in OS X:
If the file doesn't exist, create a new one.export CLASSPATH=.:/Users/username/introcs/
Here are a few suggestions that might help correct any installation woes you are experiencing. If you need assistance, don't hesitate to contact a staff member.
How can I check the value of my CLASSPATH variable?
The CLASSPATH variable should begin with .;C:\introcs.C:\introcs\hello\> echo %CLASSPATH%