Previous

Platform-Specific Details: Compiling a Swing Program

When compiling a Swing program, you must use a class path that includes the swing.jar file. If you use the -classpath option (as the following examples do), you must also specify the appropriate JDK classes.zip file and the directory under which the source code lives (usually ".").

Solaris
If you've set the JAVA_HOME and SWING_HOME environment variables:
$JAVA_HOME/bin/javac -classpath .:$SWING_HOME/swing.jar:$JAVA_HOME/lib/classes.zip SomeClass.java
Which might result in something like this:
/home/me/jdk1.1.7/bin/javac -classpath .:/home/me/swing-1.1beta3/swing.jar:/home/me/jdk1.1.7/lib/classes.zip SomeClass.java

DOS shell (Windows 95/NT)
If you've set the JAVA_HOME and SWING_HOME environment variables:
[PENDING: put env variable version of following command here]
%JAVA_HOME%\bin\javac -deprecation -classpath .;%SWING_HOME%\swing.jar;%JAVA_HOME%\lib\classes.zip SomeClass.java
Which might result in something like this:
C:\java\jdk1.1.7\bin\javac -deprecation -classpath .;C:\java\swing-1.1beta3\swing.jar;C:\java\jdk1.1.7\lib\classes.zip SomeClass.java


Previous