Ubuntu 16.04 LTS Gradle Issues LWJGL 3.0.0

Started by Zellcore, June 21, 2016, 11:18:01

Previous topic - Next topic

Zellcore

Hello folks!
I have a question with Ubuntu and gradle with the actual release of LWJGL and JOML.
I did not found any similar problems in the forum so I started a new topic. I am new to LWJGL and gradle so please be gentle  :)

When I use LWJGL and JOML on windows everythink works fine. But when I want to use it on Ubuntu the actual release of LWJGL 3.0.0 is not found. When I use 3.0.0b it downloads the libraries for LWJGL. I dont have a clue what the problem could be. I have the same problem using JOML. But with JOML no version works with gradle using Ubuntu. Not only with LWJGL 3.0.0.

I am using IntelliJ on Ubuntu 16.04 LTS. Gradle version is 2.14

version 'dev'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.1"
    }
}

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'eclipse'



repositories {
    mavenCentral()
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
}

ext {
    lwjglVersion = "3.0.0"
    jomlVersion = "1.8.0"
}

dependencies {
    compile "org.lwjgl:lwjgl:${lwjglVersion}"
    compile "org.lwjgl:lwjgl-platform:${lwjglVersion}:natives-windows"
    compile "org.lwjgl:lwjgl-platform:${lwjglVersion}:natives-linux"

    compile "org.joml:joml:${jomlVersion}"

    compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.2"
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

Yes I removed the natives for mac. And yes I use the same gradle file on windows 10.

Would be nice if you can tell me if it is a problem with gradle, the repo, the IDE or the OS. I can not be the only one using Linux :D

Sincerely Zellcore

Kai

The only thing I can tell you is that I successfully used these LWJGL and JOML release versions from Ubuntu 12.10 and 14.04. Both on a VirtualBox VM within a Windows 7 host as well as on native installations.
Did you try resolving _any_ other library with Gradle? Can you for example resolve junit:junit:4.12 ?
Can you nslookup maven.org (the domain of the Maven Central repository, also used by Gradle) ?
Do any other Gradle projects you have (if any) work?

Zellcore

Quote from: Kai on June 21, 2016, 11:36:52
Did you try resolving _any_ other library with Gradle? Can you for example resolve junit:junit:4.12 ?
Can you nslookup maven.org (the domain of the Maven Central repository, also used by Gradle) ?
Do any other Gradle projects you have (if any) work?
Yes I can resolve JUnit 4.12 using "compile 'junit:junit:4.12'"or "testCompile 'junit:junit:4.12'" like shown on "The Central Repository"-Site.
And yes, nslookup maven.org also works.
I have one more project but with the same gradle file and issues.


//EDIT:
Quote from: Kai on June 21, 2016, 11:36:52
The only thing I can tell you is that I successfully used these LWJGL and JOML release versions from Ubuntu 12.10 and 14.04. Both on a VirtualBox VM within a Windows 7 host as well as on native installations.
I also tried it on Ubuntu 14.04.4 LTS and everything worked fine. But a downgrade to 14.04 can not be the solution?  ;D

Zellcore

I made a little step forward solving my problem. Now the dependencies are found and downloaded. I can code without problems. But when I want to run it, I get an exception. Under Windows it works perfectly.
Exception in thread "Game Thread" java.lang.ExceptionInInitializerError
	at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:692)
	at org.jengine.graphics.Window.init(Window.java:73)
	at org.jengine.graphics.Window.<init>(Window.java:69)
	at org.jengine.demo.Pong.init(Pong.java:159)
	at org.jengine.demo.Pong.run(Pong.java:165)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: This function is not available.
	at org.lwjgl.system.Checks.checkFunctionAddress(Checks.java:89)
	at org.lwjgl.system.APIUtil.apiGetFunctionAddress(APIUtil.java:121)
	at org.lwjgl.glfw.GLFW$Functions.<clinit>(GLFW.java:594)
	... 6 more


In GLFW.java after reading line 594 (SetWindowIcon= apiGetFunctionAddress(GLFW, "glfwSetWindowIcon")) he goes to the method Checks.java and in checkFunctionAddress() the Pointer is null. Then the exception is thrown. How can i fix it? I use no WindowIcon. Neither on Ubuntu nor Windows.

spasi

This sounds like you have mixed the 3.0.0 JAR with the 3.0.0b binary (which didn't have glfwSetWindowIcon).

Zellcore

Thanks for your answer spasi. i created a new Eclipse environment and added lwjgl manually. And it works. So at least i know everything is fine with my OS and lwjgl.
Afterwards I cleared my IntelliJ cache and deleted everything in .grade/ so it would download everything new.
But still the problem occurs. Restart the IDE and reimport did not help. Then I used "./gradlew eclipse" in a new cloned repo and tried to use it in Eclipse. Same issue.
I am not very familiar with gradle. How can i fix this issue? I have no more idea what I could do.