Could not get the JAWT interface

SchwarzerKaffee

New Member
Hello everybody,

when i try to run Terasology, i get the following error (see below). I'm using IntelliJ on a Mac OS X 10.7 system. The bug occurs with both, the latest 1.6 and 1.7 versions of Java.

I followed the instructions here http://wiki.movingblocks.net/Main/DevSetup to install the source and so on and so far everything went fine.

I already read something regarding the problem here http://lwjgl.org/forum/index.php/topic,4326.0.html but to be honest, i'm not very much into the interface between lwjgl and the underlying operating system and so I don't know if there is some kind of workaround (maybe an older version of lwjgl).

Is there anybody (maybe a terasology developer using Mac OS X) who can help me?

Thanks,

Rob
Code:
Mai 07, 2012 2:47:23 PM org.terasology.game.TerasologyEngine init
Information: Initializing Terasology...
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
Mai 07, 2012 2:47:24 PM org.terasology.game.TerasologyEngine initDisplay
Schwerwiegend: Can not initialize graphics device.
org.lwjgl.LWJGLException: Could not get the JAWT interface
	at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
	at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:51)
	at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:94)
	at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:92)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:92)
	at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:66)
	at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:57)
	at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
	at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
	at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
	at org.lwjgl.opengl.ContextGL.<init>(ContextGL.java:132)
	at org.lwjgl.opengl.Display.create(Display.java:875)
	at org.lwjgl.opengl.Display.create(Display.java:782)
	at org.terasology.game.TerasologyEngine.initDisplay(TerasologyEngine.java:272)
	at org.terasology.game.TerasologyEngine.init(TerasologyEngine.java:78)
	at org.terasology.game.Terasology.main(Terasology.java:48)
	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:601)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Interesting - thanks for the report and extra detail. Haven't seen that specific error before, and that forum post seems somewhat concerning.

I don't have a Mac to test with, but hopefully somebody else here can try something or advise. I didn't realize exactly how the Java situation was controlled by Apple on Macs. I would try an older version of Java 1.6 if it was me - I don't know if there's some sneaky workaround via which we can bundle in that JAWT thing.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps

SchwarzerKaffee

New Member
Hello Cervator,

thanks for the hints - especially for the extra effort regarding the mac stuff (as you told you don't have a mac) :)

I'll try later and post the results here!

Regards,

Rob
 

SchwarzerKaffee

New Member
Update:

Cervator, you were right regarding:

Cervator said:
are you sure the game launched appropriately with 1.6, and didn't still somehow manage to use 1.7?
I took a closer look and then i realized, that i had made available JDK 1.6 for IntelliJ from the module settings dialog, but i did not set it as JDK for the project.

I did so now, recompiled and now have got the following issue (see below) - seems that the resources (shaders, fonts) are not found. The shader exception is caught and an error message is written "Failed to read shader" whereas the FontManager does not catch the exception.

Do i have to make the project again with gradle? If yes, which settings do i have to use? If this is a bigger issue (and i'm not just too dumb :) ), i would create a new thread.

Thanks in advance,

Rob

Code:
09.05.2012 10:13:41 org.terasology.rendering.shader.ShaderProgram compileShader
INFO: Loading shader genericMesh (genericMesh_vert.glsl, type = 35633)
09.05.2012 10:13:41 org.terasology.rendering.shader.ShaderProgram readShader
SCHWERWIEGEND: Failed to read shader.
09.05.2012 10:13:41 org.terasology.game.Terasology main
SCHWERWIEGEND: Uncaught Exception
java.lang.RuntimeException: Resource not found: org/terasology/data/fonts/default.fnt
	at org.newdawn.slick.util.ResourceLoader.getResource(ResourceLoader.java:115)
	at org.terasology.logic.manager.FontManager.initFonts(FontManager.java:53)
	at org.terasology.logic.manager.FontManager.<init>(FontManager.java:48)
	at org.terasology.logic.manager.FontManager.getInstance(FontManager.java:41)
	at org.terasology.game.TerasologyEngine.initManagers(TerasologyEngine.java:325)
	at org.terasology.game.TerasologyEngine.init(TerasologyEngine.java:82)
	at org.terasology.game.Terasology.main(Terasology.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
This thread is fine :)

We had one user who would get that error when running from IntelliJ, but oddly enough not when running from the command line with "gradlew run" - try that from project root when you get a chance.

viewtopic.php?p=1586#p1586

Another user hit it due to a quirky unit test that at the time could attempt to run under some circumstances and not work, even when you were just trying to compile/run the project:

https://github.com/MovingBlocks/Terasol ... nt-5018722

Since then that test was moved elsewhere, but I wonder if it is still being triggered.
 

B!0HAX

Member
Contributor
World
How I did it for the first time under OSX:

Code:
chmod +x gradlew
./gradlew
./gradlew run
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Awesome! And which part fixed it? I know the chmod for gradlew has come up before, and I want to make sure I get the instructions right / connect to the right symptom :)
 

SchwarzerKaffee

New Member
The problem was solved by executing
Code:
./gradlew run
in the Terasology directory. I don't know what this exactly did so that afterwards the execution of Terasology worked also within IntelliJ - but it worked. Maybe somebody who knows gradle in detail can analyze the "run" part of the build.gradle file.

The
Code:
chmod +x gradlew
statement just makes gradlew executable. Beforehand (when i first tried to run Terasology with JDK 1.7) i also had executed
Code:
./gradlew idea
like described in http://wiki.movingblocks.net/Main/DevSetup.

During the next days I will install the Terasology sources on my Macbook, so afterwards i will be able to tell if the problems i had also occurs if one directly runs Terasology with JDK 1.6 or if the problem was "selfmade" by my switch from 1.7 to 1.6.

Regards,

Rob
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hmm - the gradlew run would go through all the dependency steps before executing the actual game, while gradlew idea just preps IntelliJ to load the project. Maybe the first attempts to run from IntelliJ didn't hit all the steps right, like shuffling around library jar files, etc.

And thanks - would be thrilled to see a repeat on Mac with issues noted so we can check it against the doc :)

Edit: Adding this more than a year later, woo! Another similar Mac issue with 1.7 was fixed - https://github.com/MovingBlocks/Terasology/issues/643
 

korp

New Member
Contributor
Google brought me here! I'm on a Mac and gradlew game is getting runtime errors.

I’m trying out the combat_archive branch (in a different location so there are no huge file differences) to take a look at “hit areas” as per this forum thread, but I’m getting some runtime errors. After I changed the Java version from 1.8 to 1.6, the error is now `Can not initialize graphics device`.

The full gist is here.

I've done chmod and ./gradlew idea already to no avail. It might be that the game is still launching with java 1.8 instead of 1.6. I'll try again tomorrow ~
 

PickledNipples

New Member
Based on the gist, it looks like you are still using 1.8 because of this line:
Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

That branch is 3 years old now so even though it was stable then, there is no guarantee that it would work on newer OS's or newer versions of Java.
(Also this is a 4 year old thread, you might want to open this issue up in a new thread.)
 

korp

New Member
Contributor
Based on the gist, it looks like you are still using 1.8 because of this line:
Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

That branch is 3 years old now so even though it was stable then, there is no guarantee that it would work on newer OS's or newer versions of Java.
(Also this is a 4 year old thread, you might want to open this issue up in a new thread.)
Oh - didn't notice that one. Thanks! And yeah, I was thinking that too. I'm not sure whether it was incorporated at all, to be honest, so I dunno, feels a bit lost to me
I didn't think it warranted a new thread - after all, I'm trying to run a 3 year old branch, hahaha
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I think @nh_99 was the last person who successfully tried to run that branch. Maybe he has some ideas :)

He's on Slack sometimes too.

I vaguely remember we had some issues with Macs way back when, which related to the Java 8 switch and/or video card drivers ... hard to remember by now. I hope it doesn't end up being old Java + new video card (driver) == boom or something like that.
 
Top