Trying to use LWJGL2 in web game (using CheerpJ so it's playable)
So, trying to get my game running, but i keep getting this error, what do i do?

22 Replies
Doing this for a gamejam, only have 7 days left lmao
Hi, this error is not emitted internally by CheerpJ and it does not seem to come from OpenJDK itself. Please share a minimal example demonstrating the problem and we can try to take a look.
https://digispaceproductions-brew.netlify.app/
i have the thing hosted here, if that helps
you can also use the LWJGL1 (or 2, im using 2.0) Applet example, since that has the exact same issue.
just hoping i can get this stuff working (since i did see that Minecraft was running, and that is also LWJGL2) before the end of the jam in ~7 days
Please understand that although we are willing to help we cannot guarantee any specific timeline to non-commercial users
thats fine.
though I have no idea how the minecraft demo works, is it a Applet?
No, it's a standalone application, but that is not itself the problem
I suspect the actual problem is that these JARs are ancient and signed with algorithms that are currently outdated
I can upgrade if thats required
The error happens because LWJGL is trying to validate the signature of resources
you should try to simply disable all of that
It's really pointless in the context of the Web and browser sandboxing
no idea how.
also it no longer complains with the newer version, i need to verify it works though.
I can confim the game boots if I disable this cryptographic check in the global Java security configuration, but this is not something we can ship
If the error does not happen with a new version I'll consider this problem closed
yeah false alarm, still seems to complain
how can i do that on my end?
It's not super easy due to how Java itself works, you need to replace the whole java security configuration
I cannot truly provide step-by-step instructions here, this is a Java problem more than a CheerpJ problem
does CheerpJ use Java's configuration or something?
Yes of course CheerpJ uses a complete Java configuration from OpenJDK as part of its runtime
You can use this file as a base for your modified version: https://cjrtnc.leaningtech.com/4.1/8/lib/security/java.security
Do I need to host it locally or can i replace it while initializing cheerp?
You need to host it, it's not possible to change files from the CheerpJ runtime
You need to remove the following part
SHA1 denyAfter 2019-01-01,
And then use a Java property to point the runtime to your custom version.See docs here for how to do that with CheerpJ: https://cheerpj.com/docs/reference/cheerpjInit#javaproperties
Leaning Technologies Developer Hub
cheerpjInit - CheerpJ Documentation
Set up and initialize the CheerpJ runtime environment
It will look something like this:
cheerpjInit({ javaProperties: ["java.security.properties=/app/java.security"] });
I've not tested if this works at all, I cannot do more that this.I see
thanks, at least im getting a new error now lol
eg. whatever this is:
This means the class in not found in the JARs and it is resolved from HTTP
Again, this is not a CheerpJ bug. It's how applets used to work. You might not be using the correct paths for the ljwgl jars
no idea how im not doing so, maybe im just a idiot tho
doing it on netlify now just to test on a actual provider of sorts, still fails to download them
I don't get the same error (
LWJGLUtil.class
) if I try the netlify deployment
What I see is that the download progress gets confused due to difference between HTTP request done by native Java and emulated using the browser fetch
by CheerpJ
This is not something that we can try to fix right now
I can see that all these complications come from using the LWJGL AppletLoader
you don't have to use an applet, consider using a plain Java application which is what we did to run Minecraft