Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Applets with import statements

Options
  • 22-07-2002 2:40pm
    #1
    Closed Accounts Posts: 35


    I've created an applet, which imports a (non-native to Java) library:

    import mylibrary.*;

    When I run this code as a stand-alone application, it runs fine and does everything it's meant to do quite happily. When I use this code in an applet however, I get the
    "java.lang.NoClassDefFoundError" message, saying that the library I'm importing can't be found.

    What confuses me is that if Java libraries are compiled inside the class file (and I got no errors from that), then why should I be getting this message from embedding the code in an applet?

    Any help appreciated!
    haz.


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    I'm not sure but I think with applets you need to specify a codebase parameter in the HTML that points to your jar.


  • Closed Accounts Posts: 35 hazimel


    Yup, including the jar file in the ARCHIVE tag got it to work. Thanks!


Advertisement