[SOLVED] Where is com.jme3.system.lwjgl.LwjglWindow?

Hey folks,

I’d like to use LwjglWindow.getWindowHandle().

JME SDK claims com.jme3.system.lwjgl.LwjglWindow it to be an unknown symbol, though.

U got any pointers? :thinking:

1 Like

In the absence of a local copy of the jme source code, (which you can search with whatever tools are standard for your OS) you can do a search in the GitHub repository.

In this case, the class is part of jme-lwjgl3. Make sure that this subproject has been added as one of your dependencies, and it should work.

Well the source code of the LwjglWindow class does exisit here (JME 3.3.2-stable). I’ve downloaded the corresponding jME3.3.2-stable.zip unziped it and manually added all JARs as dependencies to my project, omitting only those in the opt directory (using Intellij).

Still no LwjglWindow available, just as with JME SDK.

it would be worth to know how you build game.

There are several ways to do so (even told on wiki)

  • you can use SDK(but you probably dont?)
  • you can download JME ZIP from github using ANY IDE(that i belive you do?)
  • you can write simple Gradle build file that use Jcenter packages using ANY IDE(simply way)

as i understand you choosed second option. Then it looks like you have some issues configuring JARs visibility.

Myself when i load additional JAR files with Gradle i just use

compile fileTree(dir: 'libs', include: ['*.jar'])

but i cant know why your IDE dont see one of package or some file within it. Maybe someone else will know. (but here would need to know if you use Gradle or ANT and, because you didnt tell much as i see)

Please note many people here use Many different IDE. There are also Intellij users.(myself im using raw Netbeans)

but generally WHY add JME Jars manually instead of use prepared ones that also contains javadoc just by gradle resource action to get it.

so i would suggest use last one, see:

and

just as with JME SDK.

That sounds crazy, i used multiple versions of SDK earlier and had no issue like that, maybe its problem with new SDK versions? But generally since SDK have libs within it, it should never happen. (unless you use SDK as IDE without using its internal project feature)

I followed your advice and switched to Gradle. Then it occurred to me to bump up the version number of lwjgl from 2 to 3. Et voila LwjglWindow in all its glory!

My build.gradle:

apply plugin: 'java'

repositories {
    jcenter()
}

def jme3 = [v:'3.3.2-stable', g:'org.jmonkeyengine']
dependencies {
	compile "${jme3.g}:jme3-core:${jme3.v}"
	compile "${jme3.g}:jme3-desktop:${jme3.v}"
	compile "${jme3.g}:jme3-lwjgl3:${jme3.v}"
}

sourceSets {
	main {
		java {
			srcDirs = ['src']
		}
	}
}

Note LWJGL2 and 3 are a bit different and it would have also worked without gradle, had you included lwjgl3 instead of 2. LWJGL2 also has such a class, it’s probably slightly differently named.

Turns out it was answered in the first response but not bold enough. :slight_smile:

1 Like