Okay, I apologize for being so abrupt before - it turned out to be more difficult than I thought! I'm running Win2k - different versions of Windows tend to handle classpaths differently, namely, Micro$oft has been more thorough at disabling classpaths in newer versions of Windows!
When I registered the comm.jar in the CLASSPATH variable, it didn't take. I had to add it to the command. Like so (run in the same folder as your compiled BlackBox.class:
java -classpath BlackBox.jar;c:\java\lib\comm.jar BlackBox
That is assuming, of course, that you've copied javax.comm.properties, win32com.dll, and comm.jar to their respective folders and have jse(sdk) installed properly.
There is an even slicker way to add files to a classpath, however. On the fly in Batch Files! This way, you can run multiple versions of java and specify different classpaths for different programs, and even keep the classpath down to the darn Windows limitations. This is done like so (place in a file called something like runme.bat):
Code: Select all
@ECHO OFF
set THEPATH=%CLASSPATH%;BlackBox.jar;c:\java\lib\comm.jar
java -classpath %THEPATH% %1
Then, run it like so: runme BlackBox
Presto!
If this doesn't work, let me know what version of Windows you're running and what the error is (cut and paste).
Good luck!