I had a few questions/difficulties regarding using a mac to develop in jme.
Running produces a resulting error “IllegalStateException: GLFW may only be used on the main thread and that thread must be the first thread in the process. Please run the JVM with -XstartOnFirstThread. This check may be disabled with Configuration.GLFW_CHECK_THREAD0.”
To solve this I attempted the following:
calling “Configuration.GLFW_CHECK_THREAD0.set(false);” prior to app.start() in the main function, which produced an error “uncaught exception ‘NSInternalInconsistencyException’, reason: 'NSWindow drag regions should only be invalidated on the Main Thread”
I searched online and another big solution and one that is also in the original error itself is to add a JVM option “-XstartOnFirstThread”. I had some difficulty in locating it in the launched sdk though and i could only find the following:
however, I got no change in behavior for posting in properties and and error for posting in the second one, and neither appears to be quite the same as program properties/vm args that i see in some other imgs/screenshots from people. So maybe I’m just not finding it? If so could you let me know where to find it?
I just downloaded the latest netbeans/jmonkey sdks today if versions are relevant.
So the SDK works right? But any project you make with it doesn’t?
-XstartOnFirstThread should be the correct answer. I think the first one newer really was reported working. But now everything just depends then that what kind of project did you make? What build system you chose for the project? Ant or Gradle?
Also, if nothing else works… you can revert back to using LWJGL 2. It works on Macs.
Yeah I am able to startup a project properly and it builds w/out problems, but crashes when running.
I am using Gradle, and was wondering if maybe the screenshotted region was the wrong place to be adding args in since I never used netbeans/jmonkey sdk before (usually use intellij).
When I add it into the Arguments portion of that screenshot as “-XstartOnFirstThread” I get an error that includes “Unknown command line option ‘-X’.” so I feel like I must be doing something wrong.
For reverting to LWJGL 2 would that have any effect on the code I would write or would that mostly just affect the internal parts of the engine (so ex if I later get a windows/somehow get it working I could basically just move the project to LWJGL 3).
It should not have. If it has, you are doing something wrong. LWJGL is jMEs problem, not yours. It is not a dependency of your project. You should not pay attention to it in your code. Otherwise you hardcode yourself to certain version (implementation of jME). Well, of course we have the package jME-lwjgl and you need to include one of those in your project, but that is it.
With Gradle projects all arguments go to build.gradle file. Like so:
I tried using LWJGL 2 and it runs fine, but I did get a warning:
"com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: OpenAL EFX not available! Audio effects won’t work.
"
I was wondering if these are significant or not in your opinion (since audio seems important but im not sure why its not working, is there something else i should install for OpenAL), or if you had any ideas of how to fix you.
Other than this I had the window with the square appear fine.
EDIT: Additional output information if its useful that preceded it.
INFO: Audio Renderer Information
The println was reached and outputted so it did begin running successfully but for some reason I never saw a window and there was no java app icon that appeared on the lower bar.
This is just fine probably. I would imagine you can still have audio. Just some extensions wont work.
You probably should work towards LWJGL 3. As that is the future. But if you are just trying to settle in to jME… forget that battle. Just don’t reference any stuff from LWJGL and you should be ok later to try to get LWJGL 3 working without any code changes. And this should not be a challenge for anyone.
Also stay away from Swing/AWT. This is pre-cursor to LWJGL 3 on Macs…
If you do everything above but still can’t run your app, make sure you don’t use any Swing/AWT thing in your code.
If it’s still not working, update jdk to 11+. It is the AWTLoader in DesktopAssetManager stopped the main thread. Update JDK will fix it.
One thing that came to my mind… the default SDK Gradle project adds the following dependency org.jmonkeyengine:jme3-awt-dialogs. Take that out (build.gradle), and with the
Removing the said dependency you lose the graphic settings selection that by default pops up when you start a jME project.
As a side note, we’ll add these improvements to the SDK itself so that in the future a Mac user just might get a working LWJGL 3 app out of the box.
Edit: also I’m not sure did you figure it out, but changing between LWJGL versions is just a matter of changing the LWJGL-jme dependency between org.jmonkeyengine:jme3-lwjgl3 and org.jmonkeyengine:jme3-lwjgl