Search code examples
javaeclipseeclipse-juno

NoClassDefFoundError___The system can not find the specified path__No projects found to import


I just wrote a simple applet using Eclipse Juno, previously I got NoClassFoundError running it through web browser and after closing Eclipse and reopen it I can't even run the applet. I tried to import the project. The error this time was No project found to import. I checked with command prompts for directories to see if I can at least get to the Java file and I got a System can not find the specified path error when I tried to move the directory to the package name. How do I fix this?

package Ch02Execises;
import java.awt.Graphics ;
import javax.swing.JApplet;
public class AppletDemo1 extends JApplet {
public void paint(Graphics g){
    super.paint(g);
    g.drawString("Hello W3",20,30);
}
}

<html>
<p><h1>This is not displaying
</h1></p>
<applet CODE="AppletDemo1.class" WIDTH ="300" HEIGHT="150">
</applet> 
</html>

Solution

  • Try recovering from local history.

    If that does not work, check if there is a .classpath and .project file in the project directory. These are created by eclipse. If not present, create a new project by specifying the folder location again and try running it.

    Also you can run the applet from commandline by using appletviewer in JAVA's bin directory.