Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!postnews.google.com!18g2000yqe.googlegroups.com!not-for-mail From: simplicity Newsgroups: comp.lang.java.programmer Subject: Re: Basic question about compiling Date: Fri, 10 Feb 2012 11:26:33 -0800 (PST) Organization: http://groups.google.com Lines: 61 Message-ID: <32e4d2ce-fe5c-4f13-b8d2-e659469656ac@18g2000yqe.googlegroups.com> References: <0fffb4b6-426a-4304-a249-63de08dd6d33@d15g2000yqg.googlegroups.com> NNTP-Posting-Host: 72.2.16.10 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1328901994 8557 127.0.0.1 (10 Feb 2012 19:26:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Feb 2012 19:26:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 18g2000yqe.googlegroups.com; posting-host=72.2.16.10; posting-account=EgU86goAAAD9zE1SdNwFxseaYYWdTdJP User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALENKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/10.0,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11913 On Feb 10, 10:00=A0am, Knute Johnson wrote: > On 2/10/2012 8:12 AM, simplicity wrote: > > > > > > > > > > > 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% ^ > > =A0 =A0 =A0 =A0-classpath %CLASSPATH_1%;%CLASSPATH_2% ^ > > =A0 =A0 =A0 =A0%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..sbsdk/SBSDKListener > > > Luckily, I have the access to the sbsdk.jar source code. =A0When I copy > > the folder structure containing compiled classes of sbsdk (com\ > 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. > > Do you have an archive statement in your APPLET tag that lists all the > jar files? > > http://docs.oracle.com/javase/1.4.2/docs/guide/misc/applet.html > > -- > > Knute Johnson I do, but I only specify MyApplet.jar there. Does it mean that I should have sbsdk.jar added to archive attribute? How about plugin.jar? Obviously, I do not have the access to its compiled classes but this one loads without complains. What's the difference?