nh-99/NuclearPizzaWar-Mojam

_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib

Closed this issue · 5 comments

I realize this game is relatively ancient, but I was feeling nostalgic about it. Finally found it, downloaded, built, and it won't run under Java 6 or Java 8.

I'm a little teapot. That is all.
Thu Oct 22 22:44:08 CDT 2020 INFO:Slick Build #264
Thu Oct 22 22:44:09 CDT 2020 INFO:LWJGL Version: 2.8.5
Thu Oct 22 22:44:09 CDT 2020 INFO:OriginalDisplayMode: 1680 x 1050 x 32 @0Hz
Thu Oct 22 22:44:09 CDT 2020 INFO:TargetDisplayMode: 800 x 600 x 32 @0Hz
_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib
JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit

I did get the Humble Bundle version to "work" under Java 6 using /usr/libexec/java_home -v 1.6.0 --exec java -jar Cyborg_macos.jar -nojvm, but it spams the following error and movement keys stop working after a few seconds.

2020-10-22 22:28:49.070 java[2586:55153] *** Assertion failure in -[NSEvent _cgsEventRecord], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.60.107/AppKit.subproj/NSEvent.m:1986
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Non-Java exception raised, not handled! (Original problem: Deprecated in 10_12... DO NOT EVER USE CGSEventRecord directly. Bad things, man.... bad things.)
	at apple.awt.ComponentModel._handleEvent(Native Method)
	at apple.awt.ComponentModel.handleEvent(ComponentModel.java:273)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:753)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1000)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:865)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:686)
	at java.awt.Component.dispatchEventImpl(Component.java:4648)
	at java.awt.Component.dispatchEvent(Component.java:4604)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
	at java.awt.EventQueue.access$400(EventQueue.java:82)
	at java.awt.EventQueue$2.run(EventQueue.java:676)
	at java.awt.EventQueue$2.run(EventQueue.java:674)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:690)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Is there any way to get this working on Java 8 under Mac OSX 10.14.6? I totally understand if you don't want to mess with this, all questions are worth asking once though.

nh-99 commented

I actually just re-ran this project recently for the nostalgia as well :) these errors are happening because of the LWJGL native's version. If you upgrade your natives in the lib/macosx folder, you may have better luck. Let me know how it works!

I downloaded the latest stable release and replaced the files in the /lib/natives/macosx folder, then rebuilt the jar. I know how to use the terminal, but do not believe for a second I know anything about programming, so talk to me like a child if you have to lol.

Now I have this:

Andrews-MacBook-Pro:dist andrewkelly$ /usr/libexec/java_home -v 1.8 --exec java -jar Cyborg-Hippos.jar -nojvm
I'm a little teapot. That is all.
Exception in thread "main" java.lang.LinkageError: Version mismatch: jar version is '23', native library version is '25'
	at org.lwjgl.Sys.<clinit>(Sys.java:118)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
	at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34)
	at com.mojang.mojam.MainClass.main(MainClass.java:18)

Scratch that, I figured it out. Didn't realize that I had to replace the jars too, whoops.

Thanks so much, I had forgotten how fun this game was. Thank you for making it and helping me get it running again!

nh-99 commented

Awesome! Honestly I had forgotten the jars needed to be replaced too. Glad you were able to get it working, enjoy