Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2004

Tip: Looking for answers? Try searching our database.

applet doesn't find class in jar in classpath but application does?

Thread view: 
Peter Signell - 17 Mar 2004 19:42 GMT
Hi - I am baffled.  The first program below, an applet, gives the
error
"NoClassDefFoundError (calpa/html/CalHTMLPane)" and stops while the
second
program, in the same directory, an application, gives no such error
and it runs.  Could you please give me a clue?  Thanks!
- Pete
------------------------------------------------------
import java.awt.*;
import javax.swing.*;
import calpa.html.*;
public class HTMLExample6 extends JApplet {
   public HTMLExample6() {
       CalHTMLPane pane = new CalHTMLPane();
   }
}
------------------------------------------------------
import java.awt.*;
import javax.swing.*;
import calpa.html.*;
public class HTMLExample7 {
   public static void main(String args[]) {
       CalHTMLPane pane = new CalHTMLPane();
   }
}
-------------------------------------------------------
Andrew Thompson - 17 Mar 2004 20:13 GMT
> Hi - I am baffled.  The first program below, an applet, gives the
> error
> "NoClassDefFoundError (calpa/html/CalHTMLPane)" and stops while the
> second
> program, in the same directory, an application, gives no such error
> and it runs.  

Are they both in the directory that
contains the calpa package directory?

What command do you use to run the app?
What HTML do you use for the applet?

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

Peter Signell - 18 Mar 2004 04:18 GMT
> > Hi - I am baffled.  The first program below, an applet, gives the
> > error
[quoted text clipped - 8 lines]
> What command do you use to run the app?
> What HTML do you use for the applet?

Thanks for replying!
1. The class files are a jar file specified in classpath.  Within the
jar file they are two levels down, in calpa/html.

2. I compiled and ran the app and the applet from the "tools" menu in
Textpad.  Textpad is a programmer's ASCII editor, not an environment.
I believe the Textpad Tools menu uses SDK's JAVAC.EXE, JAVA.EXE,
APPLETVIEWER.EXE via the Win registry.
Andrew Thompson - 18 Mar 2004 05:24 GMT
>>> Hi - I am baffled.  The first program below, an applet, gives the
>>> error
[quoted text clipped - 10 lines]
>
> Thanks for replying!

You are welcome.  Unfortunately I realise, now,
that my questions were rather unclear.

> 1. The class files are a jar file specified in classpath.  Within the
> jar file they are two levels down, in calpa/html.
>
> 2. I compiled and ran the app and the applet from the "tools" menu in
> Textpad.  Textpad is a programmer's ASCII editor,

Huh!  You are the second person I have
actually heard mention TextPad, I am using
it myself at the moment!

>..not an environment.

It's nice and lightweight, though..

> I believe the Textpad Tools menu uses SDK's JAVAC.EXE, JAVA.EXE,
> APPLETVIEWER.EXE via the Win registry.

OK.  Get the configuration up for the Java commands
Alt c, p (expand tools)
Check - Run Java Application/Applet

Both those should bring up a a pane on
the right with vars Parameters and Initial
Folder, what values do they contain?

(It might also be a great time to figure out how to
this all from the command line, you will need that
knowledge later)

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.