Why are packages not available (5 posts)

  • Profile picture of engineer1989 engineer1989 said 4 months ago:

    Hello,
    I am a beginner in JMonkeyEngine and I started today to learn more about this engine.

    I began to make the tutorials on this page. And I have a problem.
    The first Tutorial requires to import com.jme3.app.SimpleApplication.
    JME says that this package doesn`t exists.

    Where is the problem? With the installation of JME all packages have to
    be installed with.

    Thanks for help.

    Sorry if I make mistakes in my language. English isn`t my mother tongue.

  • Profile picture of engineer1989 engineer1989 said 4 months ago:

    Oh I found the problem. I had to make a JME Project. I made first a AssetPack Project.
    But I surely will have more questions today.

  • Profile picture of engineer1989 engineer1989 said 4 months ago:

    Now I have a new question.

    My Code:

    
    package Uebung2;
    
    import com.jme3.app.SimpleApplication;
    import com.jme3.font.BitmapText;
    import com.jme3.light.DirectionalLight;
    import com.jme3.material.Material;
    import com.jme3.math.Quaternion;
    import com.jme3.math.Vector3f;
    import com.jme3.scene.Geometry;
    import com.jme3.scene.Spatial;
    import com.jme3.scene.shape.Box;
    
    public class Uebung2 extends SimpleApplication{
    
        public static void main(String[] args){
            Uebung2 uebung2 = new Uebung2();
            uebung2.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);
    
            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);
            rootNode.attachChild(wall);
    
            DirectionalLight light = new DirectionalLight();
            light.setDirection(new Vector3f(-0.1f,-0.7f, -1.0f));
            rootNode.addLight(light);
    
        }
    
    }

    The program doesn`t show mistakes in the Engine but if I start it, it closes itself.

    I think the reason is, because I haven`t the data Unshaded.j3md in my MatDefs Folder.
    Brickwall.jpg is also missing.

    Where can I download this two files to start the programm.

  • Profile picture of jmaasing jmaasing9p said 4 months ago:

    Make sure you see the “Projects” tab on the left side in the IDE. There should be a node called “Libraries” there.
    Make sure it lists “jme3 – jME3-core.jar” and “jme3-test-data – jME-testdata.jar”.

    The “Common/MatDefs/Misc/…” are located inside the core JAR-file. The other resources you want to use are in the test-data.jar.

    Hope that helps.

    Cheers,
    Johan Maasing

  • Profile picture of shirkit shirkit20p said 3 months, 3 weeks ago:

    You should read the documentation. Really, this would have answered all your questions. http://jmonkeyengine.org/wiki/doku.php/jme3#tutorials_for_beginners