How to avoid specifying JAR files and libraries when running demos (Linux)?

Is there a way to configure Linux to avoid specifying the JAR files on the command line when running the demos? For example, if the JAR files are all in the CLASSPATH, and the library files are all in LD_LIBRARY_PATH (or ld.conf.so or whatever the filename is), will that work?



I haven't managed to get this working yet, but I want to put the LWJGL and JME files somewhere in /opt to ensure there's only one copy. I'm going to try using NetBeans and deal with getting that working later.



Thanks

does it need to be in LD_LIBRARY_PATH or just PATH?

I don't know - I tried both, but it doesn't work.

What I'm leading towards is this. I can compile an example in Netbeans, but it won't run. When I click the Run button, I get the following in the output window:



init:

deps-jar:

Compiling 1 source file to /home/mike/Development/Java/Test1/build/classes

compile:

debug:

BUILD SUCCESSFUL (total time: 1 second)





I've added the various libraries to the project in the Run tab. Is there something I've missed? I have:


ls /opt/jme/
jme-effects.jar  jme-model.jar  jme-terrain.jar   jmetest.jar  lib
jme.jar          jme-sound.jar  jmetest-data.jar  jme-ui.jar



ls /opt/jme/lib
jogg-0.0.5.jar         liblwjgl.jnilib  lwjglaudio.dll   lwjgl_fmod3.jar
jorbis-0.0.12.jar      liblwjgl.so      lwjgl.dll        lwjgl.jar
liblwjgl-fmod3.jnilib  libopenal.so     lwjgl-fmod3.dll  openal.dylib



Thanks

I can help you with netbeans, but in the evening (so in 12 h).

Stodge, do you use netbeans now and have problems with the setup for jME? If so please let me know and i will help you.

Justin - yes I'm trying to use Netbeans with JME. I can compile a JME app but it won't run.



Thanks

Ok, i understand you this way that you can compile the jME project without errors from netbeans (via "Clean and Build Project") and that you can compile the test applications from netbeans (via "Test Project") and that you can generate javadoc from netbeans (via "Generate Javadoc for Project") and you can also compile your own jME application project from netbeans, but you have problems to get this new jME application project to run?



Try this for your jME application project:


Thanks Justin - appreciate it. I thought I'd have to set up classpaths in Netbeans but I couldn't get them right. I'll see if I can try this tonight - my inlaws arrive tonight ( :-o ) so I'm not sure if I'll have time.



I haven't tried generating Javadoc yet - didn't realise I could do that.



Thanks again.

Haven't had chance to try this yet - not sure if I'll get to it for a few days.

I have this for my VM options, but it doesn't make any difference:



-Djava.library.path=/opt/jme/lib -cp /opt/jme/lib/lwjgl.jar:/opt/jme/lib/jogg-0.0.5.jar:/opt/jme/lib/jorbis-0.0.12.jar



Thanks

I have written a starter guide for netBeans and jme. You can find it here:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=2228.0



I hope it helps. If you run into problems, please let me know.

Thanks Justin - I'll have to double check my source code, to make sure I'm not doing something stupid. I already did that, but I sometimes get hit by code blindness.



Appreciate it.

Ok I think my code was bum, so I replaced it with one of the examples. When I run I get:


Sep 27, 2005 6:36:23 PM com.jme.app.BaseGame start
INFO: Application started.
Sep 27, 2005 6:36:23 PM com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
Sep 27, 2005 6:36:23 PM com.jme.system.PropertiesIO load
WARNING: Could not load properties: java.io.FileNotFoundException: properties.cfg (No such file or directory)



Which obviously means it can't find the configuration file. Is there anyway to not use the config file, rather than copy it to the appropriate directory for every project I create? If I need to copy it, where should it go in the NetBean project directory?

Thanks again

Don't worry, if the properties.cfg is not found it will be created (this always happens the first time you run jME in a new location).

Mojo,



As we seem to get this question frequently perhaps it would be a good idea to word that "Exception" a little differently so it doesn't seem like there's a problem when there's not?



darkfrog

I searched for properties.cfg - it isn't there. The program doesn't run, so I guess this properties exception isn't the problem?

Perhaps we should change the logging… it’s not really a “WARNING” after all. And this comes up over and over in the forum…



edit: missed Darkfrogs post. Ah well. Great Minds think alike Great Minds check page 2 of the thread.

Llama,



Don't feel bad, I do that all the time…I just skim and then regret it later when I find my foot in my mouth…this was much better than some of the things that I often find myself spouting when I only half-read a thread. :wink:



darkfrog

So my code is:


import com.jme.app.SimpleGame;
import com.jme.scene.shape.Sphere;
import com.jme.math.Vector3f;
import com.jme.bounding.BoundingBox;

public class Main extends SimpleGame {
   public static void main(String[] args) {
      Main app = new Main();
       app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);
       app.start();
   }

     protected void simpleInitGame() {
        display.setTitle("Tutorial 1");
       
        Sphere s = new Sphere("Sphere", 30, 30, 25);
        s.setLocalTranslation(new Vector3f(0,0,-40));
        s.setModelBound(new BoundingBox());
        s.updateModelBound();
        
        rootNode.attachChild(s);
     }
}



When I run, nothing appears but I get:

Sep 28, 2005 7:12:22 PM com.jme.app.BaseGame start
INFO: Application started.
Sep 28, 2005 7:12:22 PM com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
Sep 28, 2005 7:12:22 PM com.jme.system.PropertiesIO load
WARNING: Could not load properties: java.io.FileNotFoundException: properties.cfg (No such file or directory)
java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
        at com.jme.app.AbstractGame.getAttributes(Unknown Source)
        at com.jme.app.BaseGame.start(Unknown Source)
        at Main.main(Main.java:23)
Sep 28, 2005 7:12:22 PM com.jme.app.SimpleGame cleanup
INFO: Cleaning up resources.
Sep 28, 2005 7:12:22 PM com.jme.input.InputSystem getKeyInput
WARNING: KeyInput is null, insure that a call to createInputSystem was made before getting the devices.
Sep 28, 2005 7:12:22 PM com.jme.input.InputSystem getMouseInput
WARNING: MouseInput is null, insure that a call to createInputSystem was made before getting the devices.
Sep 28, 2005 7:12:22 PM com.jme.app.BaseGame start
INFO: Application ending.
BUILD SUCCESSFUL (total time: 1 second)