Ran class does not change with source code

So basically when i run my class it just keeps running at a the same state. What i mean is no matter what i do to the source code, as long as there are no errors, it just keeps running the same thing over and over. I have cleaned and rebuilt it a few times, reopened the sdk, and even created a new class and replaced all my code. It still just runs at the exact same spot. And by the way this is on the 3rd or 4th tutorial (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset) where it keeps happening

Code:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jme3test.helloworld;

/**
*

  • @author Jake
    */
    import com.jme3.app.SimpleApplication;
    import com.jme3.asset.plugins.ZipLocator;
    import com.jme3.font.BitmapText;
    import com.jme3.light.DirectionalLight;
    import com.jme3.material.Material;
    import com.jme3.math.Vector3f;
    import com.jme3.scene.Geometry;
    import com.jme3.scene.Spatial;
    import com.jme3.scene.shape.Box;

public class TestProgram extends SimpleApplication{

Spatial ninja;

public static void main(String[] args) {
    HelloAssets app = new HelloAssets();
    app.start();
}

@Override
public void simpleInitApp() {

    Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
    Material mat_default = new Material( 
        assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
    teapot.setMaterial(mat_default);
    rootNode.attachChild(teapot);

    // Create a wall with a simple texture from test_data
    Box box = new Box(Vector3f.ZERO, 2.5f,2.5f,1.0f);
    Spatial wall = new Geometry("Box", box );
    Material mat_brick = new Material( 
        assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat_brick.setTexture("ColorMap", 
        assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));
    wall.setMaterial(mat_brick);
    wall.setLocalTranslation(2.0f,-2.5f,0.0f);
    rootNode.attachChild(wall);

    // Display a line of text with a default font
    guiNode.detachAllChildren();
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText helloText = new BitmapText(guiFont, false);
    helloText.setSize(guiFont.getCharSet().getRenderedSize());
    helloText.setText("Hello World");
    helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
    guiNode.attachChild(helloText);

    // Load a model from test_data (OgreXML + material + texture)
    ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
    ninja.scale(0.05f, 0.05f, 0.05f);
    ninja.rotate(0.0f, -3.0f, 0.0f);
    ninja.setLocalTranslation(0.0f, -5.0f, -2.0f);
    rootNode.attachChild(ninja);
    // You must add a light to make the model visible
    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
    rootNode.addLight(sun);
    
    /*assetManager.registerLocator("E:/3dGames/HelloWorldTutorial/assets/town.zip", ZipLocator.class);
    Spatial gameLevel = assetManager.loadModel("main.scene");
    gameLevel.setLocalTranslation(0, -5.2f, 0);//runs as if this block is not commented
    gameLevel.setLocalScale(2);
    rootNode.attachChild(gameLevel);*/

}
    @Override
    public void simpleUpdate(float tpf) {
    // make the player rotate
   // ninja.rotate(0, 2*tpf, 0);  //runs as if its not commented
    ninja.setLocalScale(ninja.getLocalScale().x*tpf,ninja.getLocalScale().y*tpf,ninja.getLocalScale().z*tpf);
}

}


Any help would be great.

How are you running it? try SHIFT + F6

Same result man, but I was runnin it by just clicking the play button before

You are somehow not running the class that you are editing. Like, you added a package declaration and didn’t move it to the right directory or something. This will really confuse the IDE, I think.

right click your project > properties > run



& then change the main class to the one you are trying to run



If shift F6 doesnt work then somehow I doubt that this will, but i’d say its worth a shot.

@rakosky said:
Same result man, but I was runnin it by just clicking the play button before


Yeah, I didn't read this right before. If the class you are trying to run isn't the project's main class then you need to run it by right-clicking on the file and clicking the "Run" menu item.
@pspeed said:
Yeah, I didn't read this right before. If the class you are trying to run isn't the project's main class then you need to run it by right-clicking on the file and clicking the "Run" menu item.

I should have added that it is the main class in my project, and even if i do right click and run the class directly, i get the same result.
@rakosky said:
I should have added that it is the main class in my project, and even if i do right click and run the class directly, i get the same result.


Then something is seriously messed up. I go back to my suggestion that maybe the file's path doesn't match its package or something.

To really be sure it's not some other assumption that is faulty, you should put a System.out.println() in the main method with something distinct. My usual message is something like:
System.out.println( "Kilroy was here." );

If you see that message then the class is being run and something else is not what you think. If you don't see that message then you know the class is definitely not getting run.

Oh, hahah... and I just figured out what the problem is. Your main() calls:
HelloAssets app = new HelloAssets();

But your new class is not called HelloAssets. The println would have shown you that your class was getting run but that it just wasn't doing what you wanted.
2 Likes