[SOLVED] Failed to find a JmeSystem delegate!

тхЁ. 15, 2019 6:32:07 PM com.jme3.system.JmeSystem checkDelegate
SEVERE: Failed to find a JmeSystem delegate!
Ensure either desktop or android jME3 jar is in the classpath.
Exception in thread "main" java.lang.NullPointerException
        at com.jme3.system.JmeSystem.newContext(JmeSystem.java:159)
        at com.jme3.app.LegacyApplication.start(LegacyApplication.java:461)
        at com.jme3.app.LegacyApplication.start(LegacyApplication.java:442)
        at com.Test2.main(Test2.java:41)

Gradle prop:
plugins {
id ‘java’
}
apply plugin: ‘java-library’
group ‘org.contact.finewar’
version ‘1.0-SNAPSHOT’

    sourceCompatibility = 1.8

    jar {
        manifest {
            attributes "Main-Class": "com.Test2"
    }

    from {
        configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

repositories {
    jcenter()
    mavenCentral()
}
def jme3 = [v:'3.2.4-stable', g:'org.jmonkeyengine']
dependencies {
    compile "${jme3.g}:jme3-core:${jme3.v}"
    compile "${jme3.g}:jme3-bullet:${jme3.v}"
    compile "${jme3.g}:jme3-networking:${jme3.v}"
    runtime "${jme3.g}:jme3-desktop:${jme3.v}"
    runtime "${jme3.g}:jme3-lwjgl:${jme3.v}"
    runtime "${jme3.g}:jme3-plugins:${jme3.v}"
    runtime "${jme3.g}:jme3-bullet-native:${jme3.v}"
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

Gradle tasks: compileJava processResources classes jar

Make sure that the class com.jme3.system.JmeDesktopSystem exists in your classpath if you are trying to run jme from desktop.

Please, advise how I can do it
IDEA Ultimate

Your pasted Gradle build looks a little weird to me, unless I’m going crazy I think you have an odd number of braces in there, or a typo? Double check that’s accurate (or fix if you see the issue).

…To find classes in your classpath, IDEA should have some tree node in your project that you can expand to see what jars/classes are included.

Maybe its just a pasting outside a code block but when you look at these things java-library they dont look like single quotes to me.

Anyway, assuming they are single quotes, I pasted in your gradle build into a netbeans 8 project, saved, reloaded the file and ran a BasicGame and had no problems.

Sounds like it may be an IDEA problem.

Fine works with such config:

plugins {
    id 'java'
}

group 'org.contact.finewar'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

jar {
    manifest {
        attributes "Main-Class": "mainpack.Test2"
    }

    from {
        configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

repositories {
    jcenter()
    mavenCentral()
}
def jme3 = [v:'3.2.4-stable', g:'org.jmonkeyengine']
dependencies {
    compile "${jme3.g}:jme3-core:${jme3.v}"
    compile "${jme3.g}:jme3-bullet:${jme3.v}"
    compile "${jme3.g}:jme3-networking:${jme3.v}"
    compile "${jme3.g}:jme3-desktop:${jme3.v}"
    compile "${jme3.g}:jme3-lwjgl:${jme3.v}"
    compile "${jme3.g}:jme3-plugins:${jme3.v}"
    compile "${jme3.g}:jme3-bullet-native:${jme3.v}"
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

My girlfriend and I :grinning:

FineWar3

3 Likes