Re: JAR! . . .What is it good for?. . .Absolutely nothing :-)
"Richard Maher" <email@example.com> wrote in message
Well not quite; actually love JAR files, but why does the AppletViewer
SUN JDK "something", at least) insist on asking for the .CLASS file *as
as* the .JAR file?
Is this *all* applet viewers? *all* html? or just something *my* code is
If I understand your complaint correctly, it's not all applet viewers:
mine doesn't additionally ask for a JAR file when I provide it a CLASS file
nor vice versa. I can't imagine how HTML or the Java source code itself
might trigger this behaviour in your applet viewer program, so I'd have to
say "no" to your other 2 questions as well.
Also why are there no hits on "noclassdeffounderror" on SUN's website?
I believe Roedy's site, mindprod.com, has a good overview of what to do
when you encounter a NoClassDefFoundError.
In the attached *very short* code snippet, the EmpApplet class is
to invoke methods in the EmpClient class that has been built into the same
JAR file, but the only Typing that I can see (sorry not my code, but I'm
told this works on UNIX browsers) is: -
I've never heard the term "Typing" before. Based on context, I'm
guessing you're referring to the *declaration* of "client" as being of type
I'm guessing that this declares "client" as an instance of the EmpClient
class, but doesn't EmpClient have to be Imported or something?
In your code (which I've snipped), both classes are in the same package
(which happens to be the default, nameless package). Classes which are in
the same package don't need to import one another to be visible to one
another. Note that it's generally considered bad practice to use the default
package. Recommended practice is to put classes in a package whose name is
based on a domain name which you own (this is sort of to provide globally
unique package names). So if you own "google.com", you could call your
package "com.google.mypackage", for example.
EmpClient is not "inited" and the -debug gives me the noclassdeffounderror
and the browser makes no attempt to load EmpClient from the codebase.
So, how does one define a class? import?
The problem here isn't that the class isn't defined, but rather that it
class definition could not be found. Check out Roedy's recommendation on
fixing this (the URL again is
be warned that this is one of the trickier problems to try to fix.