Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Applets with import statements

  • 22-07-2002 02: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