Wrong path (possibly…) in Hello Materials Exercise 1

I was reading the Hello Materials tutorial found here

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_material



and when I tried to do the first exercise I was getting an

[java]AssetNotFoundException: Materials/LeakThrough.j3m[/java]



Trying to figure out what could be wrong, I found that if I change the path in

java assetManager.loadMaterial( "Materials/LeakThrough.j3m")[/java]

to

java assetManager.loadMaterial( "Common/Materials/LeakThrough.j3m")[/java]

everything works fine. Maybe a mistake in the tutorial or am I doing something differently? I am using jmonkeyengine through NetBeans and I have put the LeakThrough.j3m in the jME3-core.jar, in the Common/Materials folder.

uh…no your doing something wrong, you’re not supposed to recompile the engine to make a game.

Just create a new Jme game project and put the LeakThrought.j3m file in the Assets/Materials folder.



You should use the SDK instead of pure NetBeans.

Indeed, I should use the SDK. I am experimenting so far only with NetBeans which is not the proper way I guess.



Thanks for the quick response nehon!

SDK is built on top of the netbeans and adds many shiny features for you :slight_smile:

or as normen puts it, netbeans is the JMEDK, but with less shiny features ^^

@wezrule said:
or as normen puts it, netbeans is the JMEDK, but with less shiny features ^^


Hah, I like that. :evil:

The tutorial says "create a file assets/Materials/LeakThrough.j3m", you should create that file in your game project directory (as discussed in a previous tutorial), not in the game engine sources.

The "Common" paths and the samples should work if you have jme and the test data jar on your classpath?
https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:sample_code

If you have any trouble or if the tutorial is unclear, I'll improve it.

@zathras

@zathras said:



If you have any trouble or if the tutorial is unclear, I’ll improve it.



Very kind of you zathras, but i think it has to do with me, because I did not use the tutorial the "normal" way (by installing the jme sdk). All I did was use Netbeans, create a new Java project and put in the classpath all the appropriate jars (I used this tutorial to set up jme https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:setting_up_netbeans_and_jme3). This way NetBeans does not give me the option to create a new jme project, which has all the necessary files and paths. So, not being able to find the appropriate path, I started "playing" with the jME3-core.jar. But I knew in the back of my mind that I must be doing something wrong, only I did not know what was it.

As a small enhancement/improvement, maybe say at the beginning of the tutorial that "the paths below will work only if you are using the jme sdk", or something like that?

Thanks a lot for your time guys.