Results 1 to 2 of 2
  1. #1
    frx08 is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default problem with finding imported classes

    Hi all, I have my class that uses the library org.apache.commons.net.ftp.FTP;
    so when I compile my class I use this command
    javac MyClass.java -cp commons-net-2.2.jar
    (the folder contains MyClass.java, commons-net-2.2.jar, index.html)
    So I compile without errors..
    but when I put the applet in index.html (<applet code="MyClass.class"></applet>)

    and I try to run the applet I get this console error:
    Java Code:
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    why, I can I solve it?

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    618
    Rep Power
    4

    Default

    Hi.
    You need read this topic
    How to Make Applets (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components).
    You need to set all library, which you use in applet.
    For example:
    [code]
    <applet code="TumbleItem.class"
    codebase="examples/"
    archive="tumbleClasses.jar, tumbleImages.jar"
    width="600" height="95">
    [code]
    Skype: petrarsentev
    http://TrackStudio.com

Similar Threads

  1. Default imported packages
    By Himanshu23 in forum Java Software
    Replies: 2
    Last Post: 01-11-2011, 06:20 AM
  2. how can downloaded package be imported in java
    By aldm in forum New To Java
    Replies: 3
    Last Post: 10-08-2010, 10:16 AM
  3. show the comment in the imported class
    By javastuden in forum New To Java
    Replies: 5
    Last Post: 08-31-2010, 10:37 AM
  4. Is the imported package foo beeing used in the programm
    By cthulhufhtagn in forum New To Java
    Replies: 3
    Last Post: 11-01-2009, 04:27 PM
  5. Problem with finding the max element
    By SMHouston in forum New To Java
    Replies: 39
    Last Post: 09-13-2009, 10:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •