Trying to run an
applet using appletviewer and getting this in cmd:
c:\Users\Joshu\Downloads\Snake game\package com.zetcode>appletviewer SnakeGame.html
load: class com.zetcode/Snake.class not found.
java.lang.ClassNotFoundException: com.zetcode.Snake.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:219)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:152)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:634)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:799)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:728)
at sun.applet.AppletPanel.run(AppletPanel.java:378)
at java.lang.Thread.run(Thread.java:748)
This is what is in the directory I'm calling appletviewer from:
Directory of c:\Users\Joshu\Downloads\Snake game\package com.zetcode
18/07/2017 14:21 <DIR> .
18/07/2017 14:21 <DIR> ..
18/07/2017 13:44 187 Board$1.class
18/07/2017 13:44 1,143 Board$TAdapter.class
18/07/2017 13:44 4,654 Board.class
18/07/2017 12:49 5,629 Board.java
18/07/2017 13:44 468 Snake$1.class
18/07/2017 13:44 782 Snake.class
18/07/2017 12:50 683 Snake.java
18/07/2017 14:24 221 SnakeGame.html
8 File(s) 13,767 bytes
2 Dir(s) 435,662,188,544 bytes free
This is the html file:
<!DOCTYPE html>
<html>
<head>
<title>Snake Game</title>
</head>
<body>
<APPLET code="com.zetcode/Snake." width="300" height="180"> Sorry your browser isn't able to run
java applets
</APPLET>
</body>
</html>
This is the Snake.java file:
This is the board.java file:
Any ideas?