Eclipse - AssetManager loadTexture()

Why this code doesn’t work on Eclipse, but it’s working on JME IDE?



Material mat = new Material(am, “Common/MatDefs/Misc/Unshaded.j3md”);

mat.setTexture(“ColorMap”, assetManager.loadTexture(“Textures/test.png”));

Did you add the “assets” directory to your Eclipse project’s build path as a source folder? Like by default the “src” and maybe “test” directory are…

How can I change that?



Sorry for my English…

If you don’t even know how to set the class path in eclipse, why don’t you just use the SDK?

Oh, good… I’m glad this question was covered on Sunday. Maybe we can go the whole week without it being asked again. :slight_smile:

How can I change that?

It's one of the basics of Eclipse... You should learn to fix that kind of problem yourself. If you can't, just use the SDK.

Right-click on jMonkey's project -> Build Path -> Configure Build Path ...

Then make sure your Sources are configured correctly.

Common.MatDefs are in src/core-data