Need some assistance getting jME running with Maven!

Hello all,



I've been following the Maven & jME guide here: http://www.jmonkeyengine.com/wiki/doku.php?id=jme_maven_setup



I get to the point about 3/4 of the way down the page where it has you run

mvn exec:java



That returns an error, running mvn exec:java with the -e flag returns this:


+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO]
[INFO] Building jme-sample
[INFO]    task-segment: [exec:java]
[INFO]
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java]
[INFO]
[ERROR] BUILD ERROR
[INFO]
[INFO] An exception occured while executing the Java class. com.mypackage.jmesample.App

[INFO]
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured while executing the Java class. com.mypackage.jmesample.App
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. com.mypackage.jmesample.App
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:345)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: java.lang.ClassNotFoundException: com.mypackage.jmesample.App
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
at java.lang.Thread.run(Thread.java:613)
[INFO]
[INFO] Total time: 1 second
[INFO] Finished at: Sun Feb 01 00:41:53 EST 2009
[INFO] Final Memory: 5M/9M
[INFO]





Would someone be able to take a quick look and at least tell me where is should be looking for errors?  my project name is jme-sample and the group ID is mypackage.  the error references jmesample (note the lack of hyphen, which is in my project name)  I'm not sure If the App.class or App.java file is what is causing the problem, or if it is another..?

Any help would be GREATLY appreciated.. Thanks :)

Seems com.mypackage.jmesample.App.java dosent exist or it hasn't compiled.

Is there a App.class file?

EDIT: nvm, got it working in netbeans :slight_smile:

Hi jme community.



I'm trying to compile jme with maven and run a test program according to the wiki article.

But i'm getting errors for the DiskAngleTest and the TubeAngleTest.


java.lang.Exception: No runnable methods


in both cases.
When i remove those two classes everything compiles fine.
I create a simple project like in the wiki, though in the standard configuration the <main.class> attribute in the pom.xml has to be changed to com.mypackage.App to avoid the error reported by sbook above.

mvn clean install throws a warning

[INFO] Scanning for projects...
[INFO]
[INFO] Building jme-sample
[INFO]    task-segment: [clean, install]
[INFO]
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /home/zenon/Documents/dev/projects/jme-sample/target (included: [**], excluded: [])
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/zenon/Documents/dev/projects/jme-sample/src/main/resources
[WARNING] POM for 'com.jmonkeyengine:jme:pom:2.0-SNAPSHOT:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.

[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to /home/zenon/Documents/dev/projects/jme-sample/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/zenon/Documents/dev/projects/jme-sample/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 1 source file to /home/zenon/Documents/dev/projects/jme-sample/target/test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /home/zenon/Documents/dev/projects/jme-sample/target/surefire-reports

T E S T S
Running com.mypackage.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /home/zenon/Documents/dev/projects/jme-sample/target/jme-sample-1.0-SNAPSHOT.jar
[INFO] [assembly:single {execution: bundle-project-sources}]
[INFO] Reading assembly descriptor: assembly.xml
[INFO] Processing DependencySet (output=lib)
[WARNING] POM for 'com.jmonkeyengine:jme:pom:2.0-SNAPSHOT:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[INFO] Building zip: /home/zenon/Documents/dev/projects/jme-sample/target/jme-sample-1.0-SNAPSHOT-release.zip
[INFO] [install:install {execution: default-install}]
[INFO] Installing /home/zenon/Documents/dev/projects/jme-sample/target/jme-sample-1.0-SNAPSHOT.jar to /home/zenon/.m2/repository/com/mypackage/jme-sample/1.0-SNAPSHOT/jme-sample-1.0-SNAPSHOT.jar
[INFO] Installing /home/zenon/Documents/dev/projects/jme-sample/target/jme-sample-1.0-SNAPSHOT-release.zip to /home/zenon/.m2/repository/com/mypackage/jme-sample/1.0-SNAPSHOT/jme-sample-1.0-SNAPSHOT-release.zip
[INFO]
[INFO] BUILD SUCCESSFUL
[INFO]
[INFO] Total time: 6 seconds
[INFO] Finished at: Sat Feb 13 14:20:15 CET 2010
[INFO] Final Memory: 22M/107M
[INFO]


and running it hangs at

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] Building jme-sample
[INFO]    task-segment: [exec:java]
[INFO]
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[WARNING] POM for 'com.jmonkeyengine:jme:pom:2.0-SNAPSHOT:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[INFO] [exec:java {execution: default-cli}]
Feb 13, 2010 2:20:19 PM com.jme.app.BaseGame start
INFO: Application started.
Feb 13, 2010 2:20:19 PM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
Feb 13, 2010 2:20:19 PM com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.


I can import the maven project, both for jme itself and the sample project in eclipse.
In eclipse the path for the lwjgl is unset and changes are not saved which is kinda strange since they are set in the pom.xml. But this seems to be the problem that i cannot save paths. It may be an eclipse issue but i don't know how to solve it. Trying to run the sample app as java application inside eclipse then of course throws an error.

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path


I have read the wiki article related to this, but since i cannot save path information it does not help me.

I was able to compile and run jme and examples from within eclipse alone but i want to use maven. Plz help, i can't fiugre out why the pom.xml for the jme is invalid.