SDK links to packaged tutorial source code, not mine,

So I was following along with the beginner tutorials, manually creating the “jme3test.helloworld.HelloAssets” class by pasting code from the website. It was able to compile and run just fine.

I then made a few modifications to the code, and the debug output presented me with an unexpected error (Material parameter not defined: ColorMap). I clicked the link to visit the line in my code which was throwing the exception “at jme3test.helloworld.HelloAssets.simpleInitApp(HelloAssets.java:39)”, and was quite surprised to see the SDK bring up not my modified HelloAssets.java, but “jme3test/helloworld/HelloAssets.java in C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jMonkeyEngine3-sources.zip”.

Line 39 in the packaged tutorial source code is an import line, whereas line 39 in my modified tutorial code is “mat_brick.setTextureParam(…”, so it’s fairly safe to say that the compiler is looking at the correct source file, but the the SDK (or netbeans) erroneously references a source package bundled with the SDK.

You either use an old version of the SDK (download RC2) or you use a JmeTests project instead of a BasicGame project for your own code.

Thanks for the suggestions, but no, I am using RC2 and a BasicGame project.

Steps to reproduce:

  1. Create new Basic Game project, named “HelloWorldTutorial”

  2. Create a new class “HelloAssets” under the package “jme3test.helloworld”

  3. Replace the contents of this class with the source code from https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset

  4. Add the library “jme3-test-data” to your project.

  5. Clean and build.

  6. Verify normal execution.

  7. Modify line 34 to read “assetManager, “Common/MatDefs/Light/Lighting.j3md”);”

Run the project. You should receive an IllegalArgumentException: Material parameter is not defined: ColorMap

Follow the stack trace and click the link: at jme3test.helloworld.HelloAssets.simpleInitApp(HelloAssets.java:35)

You will see that the SDK brings up the packaged tutorial source code, not your modified source code.

Nope, can’t reproduce that. Do you use nightly or changed the library sets at some point? jMonkeyEngine3.jar may not be on the classpath. If it is you have some old setting / project or whatever.

I think if you name your classes exactly the same as some other class that’s already in the SDK then you are bound to run into confusion sometime. Better to name your classes by your own name instead of reusing a class name that already exists.

I’m using a fresh install of jme3 rc2, and have not modified the libraries. jMonkeyEngine3.jar is not on my Windows CLASSPATH - should it be? Current directory is on the cp.

I mostly work with NetBeans, new to the SDK. Anyway, It’s not stopping me from doing anything in particular, but figured it might point to something more sinister down the line. Thanks either way for your support.

@pspeed said: I think if you name your classes exactly the same as some other class that's already in the SDK then you are bound to run into confusion sometime. Better to name your classes by your own name instead of reusing a class name that already exists.
Not really, no. The project has its own classpath, the SDK classpath is even restricted per plugin. The default sets don't have the test classes, they don't exist in the whole SDK apart from the JmeTests template actually. Only way is the source files are found somewhere else..

@bryanf However from what I get the problem really isn’t one as you don’t need to inspect a class to get to the code of a file that you just compiled from the same code you want to see now :? How about just double-clicking the code file instead?