Applet trouble - NoClassDefFoundError

后端 未结 3 1240
太阳男子
太阳男子 2020-12-18 08:01

I realize there\'s a million of these posts but none of them have helped me so here goes: I\'m trying to deploy a very, very simple applet that will not load properly. My HT

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-18 08:59

    NoClassDefFoundError: Ahmed (wrong name: intoapplet/Ahmed )

    I've been searching for a solution for 3 days .

    Your advice:

    If you have named your class 'test' Coding convention recommends it should be 'Test'.

    This helped me along with not including the package declaration in my Java class. By saving the project with the first letter of it's name as capital.(using eclipse).

    ----------------------------------Java code: --------------------------------

        import java.awt.*;
        import javax.swing.*;
    
        public  class  Ahmed extends JApplet {
    
        private static final long serialVersionUID = 1L;
    
        public void paint(Graphics g){
        super.paint(g);
        g.drawString("my name is Ahmed Zaki wow this actually
        works",300,300);                     
        }
        }
    

    ----------------------------------HTML code----------------------------------

        
        
        Tutorial applet
        
        
    
         
    
        
        
        
    

    -------Directory on the open-source SFTP , FTP, WebDAV and SCP client-------

    Both , class & html file , in the /public_html/ folder by using "WinSCP" which is a free and open-source SFTP, FTP, WebDAV and SCP client for Microsoft Windows. Its main function is secure file transfer between a local and a remote computer.

        example:
    
        directory for html file = /public_html/index.html
        directory for class file = /public_html/Ahmed.class
    
        example no2:
    
        +-- public_html
        |   +-- index.html
        |   +-- Ahmed.class
    

提交回复
热议问题