Results 1 to 4 of 4
  1. #1
    i_am.jayar is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Embeding Applet to HTML error: ClassNotFoundException

    Hello guys! This is my first time to try to put my applet to html

    my class file is located in C:\Documents and Settings\Jayar\workspace\NoneApp\bin

    my html is on my desktop and its code is:

    <html>
    <title>My Applet</title>
    <hr>
    <applet code="MyApp.class" width=300 height=300></applet>
    </hr>
    </html>

    now, when I open the html file, the applet never run and I got this error ClassNotFoundException

    here are the details:

    Java Plug-in 10.15.2.03
    Using JRE version 1.7.0_15-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Jayar
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    initializing...
    starting...
    stopping...
    preparing for unloading...
    Match: beginTraversal
    Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
    platform is: 1.7
    product is: 1.7.0_15
    location is: http://java.sun.com/products/autodl/j2se
    path is: C:\Program Files\Java\jre7\bin\javaw.exe
    args is:
    native platform is: Windows, x86 [ x86, 32bit ]
    JavaFX runtime is: JavaFX 2.2.7 found at C:\Program Files\Java\jre7\
    enabled is: true
    registered is: false
    system is: true

    Match: ignoring maxHeap: -1
    Match: ignoring InitHeap: -1
    Match: digesting vmargs: null
    Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
    Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
    Match: digest LaunchDesc: null
    Match: digest properties: []
    Match: JVM args: [JVMParameters: isSecure: true, args: ]
    Match: endTraversal ..
    Match: JVM args final:
    Match: Running JREInfo Version match: 1.7.0.15 == 1.7.0.15
    Match: Running JVM args match: have:<> satisfy want:<>

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,750
    Rep Power
    19

    Default Re: Embeding Applet to HTML error: ClassNotFoundException

    Where is the full exception and stack trace?
    Because that tells you what class it cannot find.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,253
    Rep Power
    25

    Default Re: Embeding Applet to HTML error: ClassNotFoundException

    I don't see how the browser loading an html file from the desktop could ever find the class file that is buried deep in another folder. Try moving the html file and the class file to the same folder.
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    i_am.jayar is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: Embeding Applet to HTML error: ClassNotFoundException

    Hey Thanks to you all. I put the html file to the same folder with the class and it worked.

    Now, I am starting to learn other things about applet.

    Thanks!

Similar Threads

  1. Getting ClassNotFoundException error.
    By kunalgaurav18 in forum Java Servlet
    Replies: 2
    Last Post: 01-02-2013, 04:05 PM
  2. Error -- java.lang.ClassNotFoundException
    By dewitrydan in forum New To Java
    Replies: 18
    Last Post: 03-02-2012, 04:25 PM
  3. ClassNotFoundException with Applet and new JRE
    By marrra in forum Java Applets
    Replies: 3
    Last Post: 06-22-2010, 11:13 AM
  4. Replies: 0
    Last Post: 10-22-2009, 11:19 AM
  5. [SOLVED] ClassNotFoundException Error
    By dan0 in forum Java Applets
    Replies: 2
    Last Post: 03-03-2009, 08:00 PM

Posting Permissions

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