2

How can I debug further into the root cause of a version mismatch with natives?

I'm fiddling with LibGDX applets and creating a shaded uber-jar to get around all the signing nonsense (I strip out all the existing certificates, and then sign my own onto the shaded jar).

When I load up the applet on a page served by a local instance of Tomcat I get the following exception:

This occurred while 'Switching applet'
null
java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1272)
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1247)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:778)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.LinkageError: Version mismatch: jar version is '25', native library version is '19'

I gather this is because there are Java classes expecting a particular version of a native library, but the native found is older. How can I find where these version numbers are defined, so I can attempt to track down the source of the mismatch?

Here's my Maven (yes, I know, nobody likes Maven) dependency tree. I'm using LibGDX 1.0-SNAPSHOT, which I believe depends on LWJGL 2.9.0. I'm probably missing something, but I can't see any older versions of natives sneaking their way in.

[INFO] com.binarytweed:f2pmsoppa-libgdx-core:jar:1.0-SNAPSHOT
[INFO] +- com.binarytweed:f2pmsoppa-libgdx-scripting:jar:1.0-SNAPSHOT:compile
[INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.7:compile
[INFO] |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.7:compile
[INFO] +- com.binarytweed:f2pmsoppa-libgdx-shared:jar:1.0-SNAPSHOT:compile
[INFO] +- com.badlogicgames.gdx:gdx:jar:1.0-SNAPSHOT:compile
[INFO] +- com.google.guava:guava:jar:14.0:compile
[INFO] +- cglib:cglib:jar:3.0:compile
[INFO] |  \- org.ow2.asm:asm:jar:4.0:compile
[INFO] +- org.ow2.asm:asm-util:jar:4.0:compile
[INFO] |  \- org.ow2.asm:asm-tree:jar:4.0:compile
[INFO] |     \- (org.ow2.asm:asm:jar:4.0:compile - omitted for duplicate)
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] |  +- (org.hamcrest:hamcrest-core:jar:1.1:test - omitted for conflict with 1.3)
[INFO] |  \- org.objenesis:objenesis:jar:1.0:test
[INFO] +- com.badlogicgames.gdx:gdx-backend-lwjgl:jar:1.0-SNAPSHOT:test
[INFO] |  +- (com.badlogicgames.gdx:gdx:jar:1.0-SNAPSHOT:test - omitted for duplicate)
[INFO] |  +- com.badlogicgames.gdx:gdx-openal:jar:1.0-SNAPSHOT:test
[INFO] |  |  +- (com.badlogicgames.gdx:gdx:jar:1.0-SNAPSHOT:test - omitted for duplicate)
[INFO] |  |  +- (org.lwjgl.lwjgl:lwjgl:jar:2.9.0:test - omitted for duplicate)
[INFO] |  |  +- com.badlogicgames.jlayer:jlayer:jar:1.0.1-gdx:test
[INFO] |  |  \- org.jcraft:jorbis:jar:0.0.17:test
[INFO] |  +- org.lwjgl.lwjgl:lwjgl:jar:2.9.0:test
[INFO] |  |  +- org.lwjgl.lwjgl:lwjgl-platform:jar:natives-windows:2.9.0:test
[INFO] |  |  +- org.lwjgl.lwjgl:lwjgl-platform:jar:natives-linux:2.9.0:test
[INFO] |  |  +- org.lwjgl.lwjgl:lwjgl-platform:jar:natives-osx:2.9.0:test
[INFO] |  |  \- net.java.jinput:jinput:jar:2.0.5:test
[INFO] |  |     +- net.java.jutils:jutils:jar:1.0.0:test
[INFO] |  |     +- net.java.jinput:jinput-platform:jar:natives-linux:2.0.5:test
[INFO] |  |     +- net.java.jinput:jinput-platform:jar:natives-windows:2.0.5:test
[INFO] |  |     \- net.java.jinput:jinput-platform:jar:natives-osx:2.0.5:test
[INFO] |  \- org.lwjgl.lwjgl:lwjgl_util:jar:2.9.0:test
[INFO] |     \- (org.lwjgl.lwjgl:lwjgl:jar:2.9.0:test - omitted for duplicate)
[INFO] +- com.badlogicgames.gdx:gdx-platform:jar:natives-desktop:1.0-SNAPSHOT:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- (org.hamcrest:hamcrest-core:jar:1.3:test - omitted for conflict with 1.1)
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test

Any help would be much appreciated!

DeejUK
  • 12,891
  • 19
  • 89
  • 169
  • The libgdx support page suggests re-downloading a distro to ensure that you have the same version of both the jars and native code. – Samhain Jan 15 '14 at 14:15
  • Thanks. I'm getting the distro from Maven though, so I'm assuming it should 'just work', unless I"m pulling in natives form somewhere unbeknownst to me. – DeejUK Jan 15 '14 at 14:41
  • Use gdx-setup in the main directory when you download libGDX. – Scuba Steve Oct 26 '14 at 20:15

0 Answers0