Hi, I’m trying to publish my app using JME as applet. I’ve enabled applet creation in my project properties, clean, and build the project. Here’s my log output when building:
ant -f D:\\workspaces\\JMonkeyEngine\\Simmal clean jar
init:
deps-clean:
Updating property file: D:\workspaces\JMonkeyEngine\Simmal\build\built-clean.properties
Deleting directory D:\workspaces\JMonkeyEngine\Simmal\build
clean:
Building jar: D:\workspaces\JMonkeyEngine\Simmal\build\assets.jar
init:
deps-jar:
Updating property file: D:\workspaces\JMonkeyEngine\Simmal\build\built-jar.properties
Created dir: D:\workspaces\JMonkeyEngine\Simmal\build\classes
Created dir: D:\workspaces\JMonkeyEngine\Simmal\build\empty
Compiling 3 source files to D:\workspaces\JMonkeyEngine\Simmal\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
compile:
Created dir: D:\workspaces\JMonkeyEngine\Simmal\dist
Copying 1 file to D:\workspaces\JMonkeyEngine\Simmal\build
Copy libraries to D:\workspaces\JMonkeyEngine\Simmal\dist\lib.
Building jar: D:\workspaces\JMonkeyEngine\Simmal\dist\MyGame.jar
To run this application from the command line without Ant, try:
java -jar "D:\workspaces\JMonkeyEngine\Simmal\dist\MyGame.jar"
Copying 1 file to D:\workspaces\JMonkeyEngine\Simmal\build
jnlp:
Applet Creation
Expanding: C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\applet-loader.zip into D:\workspaces\JMonkeyEngine\Simmal\dist\Applet
Moving 1 file to D:\workspaces\JMonkeyEngine\Simmal\dist\Applet
Moving 1 file to D:\workspaces\JMonkeyEngine\Simmal\dist\Applet
Building jar: D:\workspaces\JMonkeyEngine\Simmal\dist\Applet\code.jar
jar:
BUILD SUCCESSFUL (total time: 1 second)
When I launch the html page in the ‘dist’ folder, the applet shows loading screen for a moment, then it occurs error:
An error occured while loading applet
Please contact support to resolve this issue
This occured while 'Determining packages to load'
i got the same error some time ago, but i am not sure, it would be better if you could install the java console for browser (to have the log of the error).
It seems that the jar loader is broken in lwjgl for applet. I tried to update my lwjgl to the lastest version but it didn’t change anything. If you give me the full stack trace i can say if it’s the same as mine.
I’ve enabled the java console on browser. When I run the applet, I get the error like this:
java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.sun.deploy.uitoolkit.impl.awt.AWTDefaultPreloader$GrayBoxPainterStarter.run(Unknown Source)
This occurred while 'Determining packages to load'
no protocol: code.jar
java.net.MalformedURLException: no protocol: code.jar
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.lwjgl.util.applet.AppletLoader.loadJarURLs(AppletLoader.java:805)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:840)
at java.lang.Thread.run(Unknown Source)
Is it because I didn’t extend my application from Applet? My Main only extend from SimpleApplication.
This is exactly what i got. It worked before (i had an application with a web-applet version) and later it broke without any change from me.
I think that the problem come from lwjgl as i found a topic with the same error on their website. Maybe it’s because of a java update or a firefox update or just a lwjgl update.
I can confirm this issue.
For me this works, maybe it helps:
(0. latest jme3 version?)
Download LWJGL v2.9.0
sign the lwjgl files including the natives with your own key
build the applet with the jdk
replace the old lwjgl/native files in dist with the signed
sign code.jar + data.jar with your key
(6.) try instead deploying with JS this–> http://www.ailis.de/~k/archives/63-how-to-use-java-applets-in-modern-browsers.html
[Edit] 7. clean up your temp/lwjglcache folder; After my tests I forgot to delete the old Natives and my app didn’t work to, got beads of sweat on my forehead :roll:
You need to sign everything, excect the .html
As you can see most of the files have the date 10/3/2012 , you can’t replace one of them with a newer one, otherwise you will get strange errors.
.lzma means you have a compressed archive. You can open/make it e.g. with 7zip. For the first time you don’t need lzma’s. I noticed, sometimes the .lzma is bigger than the pure .jar. So I don’t make lzma’s all the time.
For me I made two batch files:
[java]
echo off
cd d:
cd D:\YOURPATH\lwjgl-2.9.0\native\windows
jar cvf D:\YOURPATH\lwjgl-2.9.0\native\windows_natives_290.jar .
cd D:\YOURPATH\lwjgl-2.9.0\native\linux
jar cvf D:\YOURPATH\lwjgl-2.9.0\native\linux_natives_290.jar .
cd D:\YOURPATH\lwjgl-2.9.0\native\macosx
jar cvf D:\YOURPATH\lwjgl-2.9.0\native\macosx_natives_290.jar .
cd D:\YOURPATH\lwjgl-2.9.0\native\solaris
jar cvf D:\YOURPATH\lwjgl-2.9.0\native\solaris_natives_290.jar .
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\windows_natives_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\native\windows_natives_290.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\linux_natives_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\native\linux_natives_290.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\macosx_natives_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\native\macosx_natives_290.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\solaris_natives_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\native\solaris_natives_290.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\lwjgl_util_applet_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\jar\lwjgl_util_applet.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\lzma_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\jar\lzma.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\jinput_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\jar\jinput.jar ANOTHERANOTHERPASSWORD
jarsigner -keystore D:\YOURPATH\Key\YourCertificate.jks -storepass PASSWORDXY -keypass ANOTHERPASSWORDXY -signedjar D:\YOURPATH\htdocs\lwjgl_290_signed.jar D:\YOURPATH\lwjgl-2.9.0\jar\lwjgl.jar ANOTHERANOTHERPASSWORD
[/java]
The first one builds, signs and copies the LWJGL files where i want them. I need to run it only if I update the LWJGL version or you need it everytime if you use the dist folder because sdk overwrite it.
The second signes and copies the code and data jar.
Adjust the Path/filenames as you need it…