Error : Scene can not be null ! Help?

Hello i want to know what is the error here, once I run, a message saying Scene can not be null appears.


  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    package jme3test.helloworld;

import com.jme3.math.FastMath;
import com.jme3.math.Plane;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
import com.jme3.util.SkyFactory;
import com.jme3.water.SimpleWaterProcessor;


  • @author Maha
    public class trial1 extends SimpleApplication {

    SimpleWaterProcessor waterProcessor;
    Spatial waterPlane;
    Node sceneNode;
    Node mainScene;

    public static void main(String[] args){
     trial1 app = new trial1();


    public void simpleInitApp() {

    assetManager, “Textures/Sky/Bright/”, false));

         // we create a water processor

    waterProcessor = new SimpleWaterProcessor(assetManager);

    // we set the water plane
    Vector3f waterLocation=new Vector3f(0,-6,0);
    waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y,;

    // we set wave properties
    waterProcessor.setWaterDepth(40); // transparency of water
    waterProcessor.setDistortionScale(0.05f); // strength of waves
    waterProcessor.setWaveSpeed(0.05f); // speed of waves

    // we define the wave size by setting the size of the texture coordinates
    Quad quad = new Quad(400,400);
    quad.scaleTextureCoordinates(new Vector2f(6f,6f));

    // we create the water geometry from the quad
    Geometry water=new Geometry(“water”, quad);
    water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
    water.setLocalTranslation(-200, -6, 250);



mainScene is null.

I might recomment first getting used to java before programming a game?