Reputation: 483
I'm trying to use my java applet on a html document but It just keeps giving the same errors over and over again. I'm using eclipse. When i debug/run the applet it all works fine, but when I export it to a jar file and try to use it with a html document it gives this error:
java.lang.NoClassDefFoundError: org/newdawn/slick/opengl/Texture
Here is my java code: http://pastebin.com/B3R6nj1a
This is what the .jar file contains:
-lib
-jars
lwjgl.jar
lwjgl_util.jar
slick-util.jar
-natives-win
*all the dlls*
-META-INF
-*files*
-res
grass.png
wood.png
.classpath
.project
Camera.class
Main$1.class
Main$2.class
Main.class
I do have everything right in the build path from my project. (So added the three external jars. And added native-win to lwjgl.jar)
This is my html code:
<html>
<head>
</head>
<body>
<applet archive='3dtest.jar' Code='Main' width = "640" height = "480"></applet>
</body>
</html>
I've also tried to change "Code='Main' " to "Code='Main.class'" also didn't work.
Does anybody has any idea why I'm getting the error? Thanks in advance.
-Tim
EDIT: .classpath file: http://pastebin.com/i7y4XYaf
Upvotes: 1
Views: 135
Reputation: 168825
This is what the .jar file contains:
-lib -jars lwjgl.jar ...
Those Jars should not be there. They should be separate Jars on the site referenced something like this:
<html>
<head>
</head>
<body>
<applet
archive='3dtest.jar,lwjgl.jar,lwjgl_util.jar,slick-util.jar,all_dlls.jar..'
code='Main'
width="640"
height="480">
</applet>
</body>
</html>
That is presuming the HTML is in the same directory as all the Jars.
Upvotes: 1
Reputation: 5137
You need to make sure your applet is packaged properly when deploying it. See http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
Upvotes: 0
Reputation: 1349
You need to post relevant code, not everything and hope someone will pick through it all.
java.lang.NoClassDefFoundError: org/newdawn/slick/opengl/Texture
means that class is not present in your classpath.
Upvotes: 0