Basic question about compiling



I know this is kind of basic but somehow the solution escapes me.

I have the applet which is supposed to hook up with the hardware
attach to the computer. The hook-up interface is available in the
external JAR archive called sbsdk.jar. So, I compile the applet with
the following command:

javac -d %DST% ^
-classpath %CLASSPATH_1%;%CLASSPATH_2% ^
%SRC%\MyApplet.java >%DST%\MyApplet.log 2>%DST%\MyApplet.err

where
%CLASSPATH_1% points to the location of the sbsdk.jar, namely "C:\Users
\User\\Java\lib\sbsdk.jar"
and
%CLASSPATH_2% points to "%JRE%\lib\plugin.jar" (for JSObject to
communicate with javascript in the page).

OK, so far so good. Applet compiles with no issues. But that's where
it ends. When I load the HTML file containing the applet into a
browser I am getting the exception

Exception in thread "thread applet-MyApplet.class-1"
java.lang.NoClassDefFoundError: com.<blah-blah>.sbsdk/SBSDKListener

Luckily, I have the access to the sbsdk.jar source code. When I copy
the folder structure containing compiled classes of sbsdk (com\<blah-
blah>\sbsdk), my applet loads and everything works as expected.

Can someone help me understand why this is happening? I know that this
is generally caused by SBSDKListener class not being available at the
run time (while it is available at compile time, hence no build
errors) but I do not understand what it means in practical terms.

.



Relevant Pages

  • Re: Trying to change code for application to an applet
    ... > trying to create an applet with it. ... get the app. ... ensure your code _does_ compile ... to update) and let you mull that over. ...
    (comp.lang.java.help)
  • Re: problems doing double-buffering on MSIE 6
    ... >>Compile that code and upload it, see if you can reproduce the problem ... We need to reproduce the problem in a *self* *contained* example first, ... Further information about the original applet is not getting ... public void updateBroken(Graphics realg) { ...
    (comp.lang.java.programmer)
  • Re: Basic question about compiling
    ... When I load the HTML file containing the applet into a ... run time (while it is available at compile time, ... compiled classes but this one loads without complains. ...
    (comp.lang.java.programmer)
  • Re: Setting a variable (NDEBUG) during compilation of a JDK 1.1 applet
    ... You could have your program accept a command line argument ), and set the NDEBUG variable based on those arguments. ... This would set it at runtime rather than compile time though. ... I missed the part where he said "applet" though, so the command line argument won't work. ... such environment variables for such purposes? ...
    (comp.lang.java.programmer)
  • Re: Basic question about compiling
    ... I compile the applet with ... my applet loads and everything works as expected. ... Your expectations are what are at fault. ... "Go do your research" is a typical response of a clueless buffoon ...
    (comp.lang.java.programmer)