Can't make my game distributable

well, after i follow the steps in: Getting Started



i try to execute my Jar file. right before the jME starts it shows a jFrame with some options about the game map, and the start button that starts the game, tough it works as intended when using netbeans, it just crashes after i press the start button on the .jar file.



anyone have a idea on why this happen? this is the code for my Main class and the jFrame:



Main class, i never changed the name of this class, it was a tutorial main class of somewhere here…

 package TerrainGenerator;

import Main.RegionMapFrame;
import java.util.logging.Level;
import java.util.logging.Logger;
 
import com.jme.app.SimpleGame;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
import com.jme.light.PointLight;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.CameraNode;
import com.jme.scene.Node;
import com.jme.scene.state.TextureState;
import com.jmex.terrain.TerrainPage;
 
public class yuki extends SimpleGame {
    private static int lastx = 0;
    private static int lasty = 0;
    public static GameMap map;
    private static CameraNode camNode;
    private static Node GroundNode = new Node();
    public static RegionMapFrame test = new RegionMapFrame();
    private static yuki app = new yuki();
    HeightMapWritter[][] nodemap;
    private static boolean finished1 = false;
    private static boolean finished2 = false;
    private static boolean finished3 = false;
    private static boolean finished4 = false;
    private static Node Quarter1 = new Node();
    private static Node Quarter2 = new Node();
    private static Node Quarter3 = new Node();
    private static Node Quarter4 = new Node();
    public static void main(String[] args) {
        app.setConfigShowMode(ConfigShowMode.ShowIfNoConfig);
        Logger.getLogger("").setLevel(Level.SEVERE);
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                test.setVisible(true);
            }
        });
       
    }
   
    public static void start2(){
        try{app.start();}
        catch(Exception e){
            test.makeLog(e);
        }
        test.dispose();
        //app.start();
    }
   
    @Override
    protected void simpleInitGame() {
        display.setTitle("yuki chachat manger tout!O_o");
        PointLight light = new PointLight();
        light.setDiffuse( new ColorRGBA( 0.75f, 0.75f, 0.75f, 0.75f ) );
        light.setAmbient( new ColorRGBA( 200f, 200f, 200f, 1.0f ) );
        light.setLocation( new Vector3f( 12, 12, 0 ) );
        light.setEnabled( true );
        lightState = display.getRenderer().createLightState();
        lightState.setEnabled( true );
        lightState.attach( light );
        rootNode.attachChild(GroundNode);
        KeyBindingManager.getKeyBindingManager().set("exit", KeyInput.KEY_ESCAPE);
        camNode = new CameraNode("", cam);
        cam.setLocation(new Vector3f(1000, 1350, 1000));
        camNode.setLocalTranslation(0,0,0);
        //this.pause = true;
        long took = System.nanoTime();
        TextureState tex = display.getRenderer().createTextureState();
        display.getRenderer().getCamera().setFrustumFar(10000f);
        TerrainPage page = new TerrainPage("page1");
        int[] pos = {0,0};
        for(int c = 0; c < 9; c++)
            for(int d = 0; d < 9; d++){
                pos[0] = c;
                pos[1] = d;
                page.attachChild(TerrainBlockLoader.generateBlock(pos, tex, ResourcePath.TextureDeadEarth));
            }
        rootNode.attachChild(page);
        System.out.println("TOOK: "+((System.nanoTime() - took)/1000000000f)+" SECS.");
        rootNode.setRenderState( lightState );   
    }
 
    @Override
    protected void simpleUpdate() {
        if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit", true)) {
            System.exit(0);
        }       
    }

}




thx for the help!

Sounds like you are not including everything you need into the .jar manifest (or maybe its in the native includes…)

Try redirecting the System.out and System.err:

(Add the following to your main method)


try{
System.setOut(new FileOutputStream("out.thx"));
System.setErr(new FileOutputStream("err.txt"));
}
catch(Exception e){}


Then post the content

i will try that as i get home today