How to run your game as an applet

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

How to run your game as an applet

Postby Thotep » Wed May 11, 2011 6:50 am

Just wrote a long post about that: http://www.thesecretpie.com/2011/05/being-like-minecraft-or-how-to-run-your.html
It's a pain to set up, but I'm making it easier for you. But remember: now you are obliged to share your game with us as an applet (if it's free or WIP)! ;)
Well, that's not a true code contribution, but I assume docs contributions are ok too?
@thotep, made Prophour23, currently working on PANZERBOMB. My blog: http://thesecretpie.com
Thotep
 
Posts: 51
Joined: Fri Dec 03, 2010 7:41 am

Re: How to run your game as an applet

Postby Obli » Wed May 11, 2011 7:04 am

I read it on my phone while going to work, and I must say it's awesome ! Figuring out that lwjgl applet specific jar file is not that easy...
Thanks a lot ;-)
Obli
 
Posts: 616
Joined: Mon Jan 10, 2011 6:18 pm
Location: Bordeaux, France

Re: How to run your game as an applet

Postby mzechner » Wed May 11, 2011 8:43 am

Great job! Can we include that in the wiki?
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: How to run your game as an applet

Postby Thotep » Wed May 11, 2011 9:04 am

Sure thing. It would be nice if someone of you tried to follow this tutorial, just to make sure it is all clear.
@thotep, made Prophour23, currently working on PANZERBOMB. My blog: http://thesecretpie.com
Thotep
 
Posts: 51
Joined: Fri Dec 03, 2010 7:41 am

Re: How to run your game as an applet

Postby Greystache » Sun May 22, 2011 7:36 pm

Beware if you are on windows, as the case of the filenames matters.
Greystache
 
Posts: 27
Joined: Sun May 15, 2011 9:03 pm

Re: How to run your game as an applet

Postby Greystache » Thu Aug 25, 2011 11:20 am

Hi guys,

Has anyone managed to get this running from a Linux browser?

I get this error: "An error occured while loading the applet. This occured while 'Switching applet'"

What does this mean? It would be awesome if it could work on multi platform and not only Windows!
Greystache
 
Posts: 27
Joined: Sun May 15, 2011 9:03 pm

Re: How to run your game as an applet

Postby radioking » Thu Aug 25, 2011 1:00 pm

That
Greystache wrote:Has anyone managed to get this running from a Linux browser?

I get this error: "An error occured while loading the applet. This occured while 'Switching applet'"

What does this mean? It would be awesome if it could work on multi platform and not only Windows!



Hey Greystache,

this is exactly what I get with my Ubuntu 10.04 64bit FireFox 3.6.20

:-(
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am

Re: How to run your game as an applet

Postby radioking » Thu Aug 25, 2011 2:43 pm

I was asked to provide Java console outputs.
But I am not getting any console window- it is not opened on applet execution...

This link did not help me much, since my Java seems to live in another place...
http://www.java.com/en/download/help/en ... _linux.xml

I don't even have a JAVA_HOME variable set in

Code: Select all
env



Luckily i can execute java as well as ControlPanel from any console directly *phew* =)

I checked to show console, but still no window popping up when starting applet in Firefox or Chromium browser.

The version info in ControlPanel says (Build 1.6.0_26-b03).
:arrow: Which is yours? :?:


I can check boxes for "tracing" and "protocol" in category "debugging"- but where do these files go? :?: :?:


Determining which java version is used in shell:

Code: Select all
$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)


So it is IcedTea, not the official Sun version (which is also installed). Maybe this is the culprit?!


Found this tip to set the default java version:

Code: Select all
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.6.0_20/bin/java" 1
sudo update-alternatives --set java /opt/java/64/jre1.6.0_20/bin/java


(This is for 64bit... you have to change the filename version jre1.6.0_20 to fit the appropriate version)



Which java plugin is installed in Firefox?

Enter in Firefox's address bar

Code: Select all
about:plugins


Mine says at bottom:

Code: Select all
IcedTea NPR Web Browser Plugin (using IcedTea6 1.9.9 (6b20-1.9.9-0ubuntu1~10.04.2))
File: IcedTeaPlugin.so
Version: The IcedTea NPR Web Browser Plugin (using IcedTea6 1.9.9 (6b20-1.9.9-0ubuntu1~10.04.2)) executes Java applets.


So.. again IcedTea...


I doubt my settings are recognized to open java console on applet execution because it is Sun's Control center and not IcedTea's ;)
Last edited by radioking on Thu Aug 25, 2011 3:12 pm, edited 1 time in total.
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am

Re: How to run your game as an applet

Postby Greystache » Thu Aug 25, 2011 3:07 pm

The path should be something like /usr/lib/jvm/java-6-sun/jre

If typing ControlPanel works, you can do "which ControlPanel" and it will tell you the path.

Anyway I had java-6-openjdk and had to install java-6-sun but now I have the ControlPanel as well. I went to the advanced settings and enabled the "show console". After that I ran firefox in a terminal, and the java debug messages are output in that same terminal. Indeed there is an error caused by the applet, here is the log (sorry for the length):

Code: Select all
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.10.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1027)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 30 more
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1027)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 40 more
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
   at java.lang.Class.getConstructor0(Class.java:2716)
   at java.lang.Class.newInstance0(Class.java:343)
   at java.lang.Class.newInstance(Class.java:325)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1028)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 35 more
This occurred while 'Switching applet'
null
java.lang.reflect.InvocationTargetException
   at java.awt.EventQueue.invokeAndWait(EventQueue.java:1045)
   at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:778)
   at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ExceptionInInitializerError
   at com.badlogic.gdx.backends.lwjgl.LwjglApplet.<init>(LwjglApplet.java:44)
   at com.machaon.quadratum.QuadratumApplet.<init>(QuadratumApplet.java:10)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1028)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   at net.sourceforge.jnlp.runtime.JNLPPolicy.getPermissions(JNLPPolicy.java:65)
   at net.sourceforge.jnlp.runtime.JNLPPolicy.implies(JNLPPolicy.java:100)
   at java.security.ProtectionDomain.implies(ProtectionDomain.java:240)
   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:371)
   at java.security.AccessController.checkPermission(AccessController.java:553)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
   at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:250)
   at java.lang.System.setProperty(System.java:744)
   at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.<clinit>(LwjglNativesLoader.java:33)
   ... 24 more

java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1027)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 30 more
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1027)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 40 more
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:923)
   at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:210)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
   at java.lang.Class.getConstructor0(Class.java:2716)
   at java.lang.Class.newInstance0(Class.java:343)
   at java.lang.Class.newInstance(Class.java:325)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1028)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   ... 35 more
This occurred while 'Switching applet'
null
java.lang.reflect.InvocationTargetException
   at java.awt.EventQueue.invokeAndWait(EventQueue.java:1045)
   at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:778)
   at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ExceptionInInitializerError
   at com.badlogic.gdx.backends.lwjgl.LwjglApplet.<init>(LwjglApplet.java:44)
   at com.machaon.quadratum.QuadratumApplet.<init>(QuadratumApplet.java:10)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1028)
   at org.lwjgl.util.applet.AppletLoader$3.run(AppletLoader.java:781)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.lang.NullPointerException
   at net.sourceforge.jnlp.runtime.JNLPClassLoader.getPermissions(JNLPClassLoader.java:551)
   at net.sourceforge.jnlp.runtime.JNLPPolicy.getPermissions(JNLPPolicy.java:65)
   at net.sourceforge.jnlp.runtime.JNLPPolicy.implies(JNLPPolicy.java:100)
   at java.security.ProtectionDomain.implies(ProtectionDomain.java:240)
   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:371)
   at java.security.AccessController.checkPermission(AccessController.java:553)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
   at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:250)
   at java.lang.System.setProperty(System.java:744)
   at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.<clinit>(LwjglNativesLoader.java:33)
   ... 24 more


If anyone has an idea about how to fix this that would be great!

Edit: indeed I also have ice-tea. I will try to switch to the sun version and see what it says!
Greystache
 
Posts: 27
Joined: Sun May 15, 2011 9:03 pm

Re: How to run your game as an applet

Postby radioking » Thu Aug 25, 2011 3:18 pm

Tried your proposal

Code: Select all
which ControlPanel


Result:

/usr/bin/ControlPanel

:) this won't help much...


EDIT: locate ControlPanel is the right command to look for install location...



Found my path to installed sun-java by going to Synaptic package manager and looking for "sun-java6-bin".

Then right mouse button -> Installed files tab

it lives in
/etc/java-6-sun

and
/usr/lib/jvm/java-6-sun-1.6.0.26


so ControlPanel would be
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/ControlPanel


I will try to switch to sun java by

Code: Select all
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun-1.6.0.26/bin/java


EDIT: No, this is not working :(
Code: Select all
update-alternatives: error: alternative /usr/lib/jvm/java-6-sun-1.6.0.26/bin/java for java not registered, not setting.


lets have a closer look....

Code: Select all
sudo update-java-alternatives --list


shows

Code: Select all
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun



I guess this will do then:

Code: Select all
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun


:shock: *damnit* =)
This does not work either!

OK, another try.. how about this?

Code: Select all
sudo update-java-alternatives --set java-6-sun


*sigh*

Code: Select all
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: alternative /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so for mozilla-javaplugin.so not registered, not setting.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.


Well, at least Java version is set to sun now obviously:

Code: Select all
$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)


Now giving browsers a restart and we'll see...
Last edited by radioking on Thu Aug 25, 2011 5:41 pm, edited 1 time in total.
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am

Next

Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest