Error when running applet with lwjgl in browser "occured when Switching applet

Hi

I would like to run applet with lwjgl library.

When I’m running test applet in eclipse

I’ve downloaded lwjgl applet library and I want to run it works well, here is code:

[java]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

<html>

<head>

<title>AppletLoader</title>

</head>

<body>



<applet code=“org.lwjgl.util.applet.AppletLoader” archive=“lwjgl_util_applet.jar” codebase="." width=“640” height=“480”>



<!-- The following tags are mandatory -->



<!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache -->

<param name=“al_title” value=“appletloadertest”>



<!-- Main Applet Class -->

<param name=“al_main” value=“org.lwjgl.test.applet.GearsApplet”>



<!-- List of Jars to add to classpath -->

<param name=“al_jars” value=“lwjgl_applet.jar, lwjgl.jar, jinput.jar, lwjgl_util.jar,katowice_signed.jar”>



<!-- signed windows natives jar in a jar -->

<param name=“al_windows” value=“windows_natives.jar”>



<!-- signed linux natives jar in a jar -->

<param name=“al_linux” value=“linux_natives.jar”>



<!-- signed mac osx natives jar in a jar -->

<param name=“al_mac” value=“macosx_natives.jar”>



<!-- signed solaris natives jar in a jar -->

<param name=“al_solaris” value=“solaris_natives.jar”>





<param name=“separate_jvm” value=“true”>

</applet>



<p>

if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the loader process.

</p>



</body>

</html>

[/java]

In the next step I’m trying run my own applet by changing parmeter al_main it doesn’t work (I added .jar with this class too).

So I found source of org.lwjgl.test.applet.GearsApplet and compiled to class file and exported to .jar and still doesn’t worl. In debug mode there is error like this "An error occured when loading applet . Please contact to support to resolve this issue . This occured when “Switching applet”.

Where is problem?

I cant say exactly but the SDK can create these with a checkbox in the project settings, maybe you create a BasicGame project and enable applet deployment to see what it creates. Afaik its important to have code and data in separate jar files which the SDK creates.

I have .jar file:

katowice_signed.jar (in the same directory where rest of libraries, package rama.dot;)

which only include:

WebContentAMDramadotapplet$1.class

WebContentAMDramadotapplet$2.class

WebContentAMDramadotapplet.class

(Code is the same as in GearsApplet)



and path of param name should look like this :



and what's interesting it doesn't work.

HI!

I removed some problem but there is one left:

Exception in thread “Thread-45” java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.opengl.Display

at rama.dot.applet$1.run(applet.java:60)

Looks like your general setup is not correct. Seriously, try to copy what the SDK does, the applets it creates work. You don’t have to sign anything yourself with the lwjgl applet launcher.

I don’t know if I understand you correctly, but It’s no problem when I’m running as applet in eclipse. There is a problem when I’m running in firefox or explorer. When I run in firefox there isn’t direct error only white window with frame and only console shows error, not browser

This is error from java console:

Exception in thread “Thread-131” java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.opengl.Display

at rama.dot.applet$1.run(applet.java:60)

Exception in thread “Thread-141” java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

at org.lwjgl.Sys$1.run(Sys.java:73)

at java.security.AccessController.doPrivileged(Native Method)

at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)

at org.lwjgl.Sys.loadLibrary(Sys.java:95)

at org.lwjgl.Sys.(Sys.java:112)

at org.lwjgl.opengl.Display.(Display.java:132)

at rama.dot.applet$1.run(applet.java:60)

You do it wrong!

Create a BasicGame project [in the SDK] and enable applet deployment to see what it creates.

Also theres info about lwjgl applets here, this is not jme specific: http://bit.ly/Q1eUOq

It may be helpful

When I’m creating applet with HelloJME3.class following error occur:



RuntimeException

java.lang.reflect.InvocationTargetException

:facepalm: