Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven: Unsupported JVM detected, this will likely result in low performance #351

Closed
markusstephanides opened this issue Nov 20, 2017 · 2 comments

Comments

@markusstephanides
Copy link

Hello!

I'm currently setting up a project with lwjgl3 and maven this is the relevant part of my pom (generated by the online tool on the website):

<properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <lwjgl.version>3.1.4</lwjgl.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-egl</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-glfw</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-jemalloc</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-openal</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-opengl</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-opengles</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-stb</artifactId>
            <version>${lwjgl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-glfw</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-jemalloc</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-openal</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-opengl</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-opengles</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-stb</artifactId>
            <version>${lwjgl.version}</version>
            <classifier>${lwjgl.natives}</classifier>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>lwjgl-natives-linux</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-linux</lwjgl.natives>
            </properties>
        </profile>
        <profile>
            <id>lwjgl-natives-macos</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-macos</lwjgl.natives>
            </properties>
        </profile>
        <profile>
            <id>lwjgl-natives-windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <lwjgl.natives>natives-windows</lwjgl.natives>
            </properties>
        </profile>
    </profiles>

But when starting the application I get this error:

java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.getCapacityOffset(MemoryAccess.java:159)
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.<clinit>(MemoryAccess.java:132)
	at org.lwjgl.system.MemoryAccess.getInstance(MemoryAccess.java:31)
	at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:62)
	at org.lwjgl.system.MemoryStack.<init>(MemoryStack.java:60)
	at org.lwjgl.system.MemoryStack.create(MemoryStack.java:81)
	at org.lwjgl.system.MemoryStack.create(MemoryStack.java:70)
	at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(ThreadLocal.java:284)
	at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180)
	at java.lang.ThreadLocal.get(ThreadLocal.java:170)
	at org.lwjgl.system.MemoryStack.stackGet(MemoryStack.java:603)
	at org.lwjgl.system.MemoryStack.stackPush(MemoryStack.java:612)
	at org.lwjgl.system.Callback.<clinit>(Callback.java:38)

And this error:

[LWJGL] [MemoryAccessor] Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers.

Would appreciate help on this!

@Spasi
Copy link
Member

Spasi commented Nov 20, 2017

The 3.1.4 build on Maven is bugged, it has been compiled with Java 9. The bytecode version is fine (Java 8), but not the boot classpath. JDK 9 introduced covariant returns in certain NIO methods and that's the error you're seeing.

Workarounds:

  • use Java 9
  • download the latest 3.1.4-SNAPSHOT (it's identical to the 3.1.4 release but compiled properly)
  • download LWJGL from the website or github (the binaries have been updated)

There will be a 3.1.5 release immediately (hopefully tonight or tomorrow morning) that will fix the Maven build.

@Spasi
Copy link
Member

Spasi commented Nov 24, 2017

Fixed with the 3.1.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants