To reduce the clutter of having 50+ class files floating about, you can use a .jar file. This would be done before distribution except that it makes running Hotpad a more complicated process.
To create the .jar file, change to the Hotpad directory and enter:
jar cvf0 classes.jar *.class
Note: that is a zero, not the letter O.
After this, you can delete all the .class files. To run Hotpad, you must tell the Java interpreter where both the Hotpad .jar file is, and the Java classes.zip file. This can be done in one of two ways:
In MS-DOS, in C:\autoexec.bat, add the line:
SET CLASSPATH=
Example:
SET CLASSPATH=C:\Hotpad\classes.jar;C:\jdk1.1.7\lib\classes.zip
or for any OS, when you run Hotpad, add the following command flag:
java -classpath
Example: or for the JDK 1.2
java -classpath C:\Hotpad\classes.jar;C:\jdk1.2\jre\lib\rt.jar Hotpad
If you are using Windows or Un*x, you can make a shortcut or shell script which will
do this automatically.
Note: Some versions of the java interpreter may have easier ways to load a program from a jar file.
Be sure to type java -? at the command prompt to see if such a way might exist.
java -classpath C:\Hotpad\classes.jar;C:\jdk1.1.7\lib\classes.zip Hotpad