Compiling Game from terminal (or duynamically)

I need to compile a game dynamically based on certain settings the user selects and models they load.

Before I can even attempt to compile dynamically, I need to be able to run the resulting file. I am having a problem with this.



I turned on verbose compilations for netbeans and tried the resulting output but it gives me errors that it can’t seem to find an image that i"m applying to the terrain. the code still compiles and runs great in netbeans, but trying to run otherwise gives me problems. The path to the image is the exact same as in the java code.



Here is what I am using to compile:



[java] java -Dfile.encoding=UTF-8 -classpath /home/user/Projects/dependencies/Octjme3/jMonkeyEngine3.jar:/home/user/Projects/dependencies/Octjme3/lib/gluegen-rt.jar:/home/user/Projects/dependencies/Octjme3/lib/j-ogg-oggd.jar:/home/user/Projects/dependencies/Octjme3/lib/j-ogg-vorbisd.jar:/home/user/Projects/dependencies/Octjme3/lib/jbullet.jar:/home/user/Projects/dependencies/Octjme3/lib/jheora-debug-0.6.0.jar:/home/user/Projects/dependencies/Octjme3/lib/jinput.jar:/home/user/Projects/dependencies/Octjme3/lib/jME3-jogl-natives.jar:/home/user/Projects/dependencies/Octjme3/lib/jME3-lwjgl-natives.jar:/home/user/Projects/dependencies/Octjme3/lib/jME3-natives-joal.jar:/home/user/Projects/dependencies/Octjme3/lib/jme3test.jar:/home/user/Projects/dependencies/Octjme3/lib/jme3testdata.jar:/home/user/Projects/dependencies/Octjme3/lib/joal.jar:/home/user/Projects/dependencies/Octjme3/lib/jogl.jar:/home/user/Projects/dependencies/Octjme3/lib/lwjgl.jar:/home/user/Projects/dependencies/Octjme3/lib/nifty-1.2-SNAPSHOT.jar:/home/user/Projects/dependencies/Octjme3/lib/nifty-default-controls-1.2-SNAPSHOT.jar:/home/user/Projects/dependencies/Octjme3/lib/nifty-examples-1.2.jar:/home/user/Projects/dependencies/Octjme3/lib/nifty-style-black-1.2-SNAPSHOT.jar:/home/user/Projects/dependencies/Octjme3/lib/nifty-style-grey-1.0.jar:/home/user/Projects/dependencies/Octjme3/lib/stack-alloc.jar:/home/user/Projects/dependencies/Octjme3/lib/swing-layout-1.0.4.jar:/home/user/Projects/dependencies/Octjme3/lib/vecmath.jar:/home/user/Projects/dependencies/Octjme3/lib/xmlpull-xpp3-1.1.4c.jar:/home/user/Projects/dependencies/Jme3/jme3_collada_lib/jme3dae.jar:/home/user/Projects/jme3_RayTest/build/classes:/home/user/Projects/jme3_RayTest/src RayTest.October2010.CleanTestPhysicsCar

[/java]





Here is the resulting error after I try to load:



[java]Dec 29, 2010 5:45:11 PM com.jme3.system.JmeSystem initialize

INFO: Running on jMonkey Engine 3 Alpha 0.6

Dec 29, 2010 5:45:11 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #1: file:/home/user/Projects/dependencies/Octjme3/

Dec 29, 2010 5:45:11 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #2: /home/adam

Dec 29, 2010 5:45:11 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #3: /home/adam

Dec 29, 2010 5:45:11 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run

INFO: Using LWJGL 2.5

Dec 29, 2010 5:45:11 PM com.jme3.system.lwjgl.LwjglDisplay createContext

INFO: Selected display mode: 640 x 480 x 0 @0Hz

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Display created.

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Adapter: null

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Driver Version: null

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Vendor: ATI Technologies Inc.

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: OpenGL Version: 3.2.9756 Compatibility Profile Context

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Renderer: ATI Radeon HD 4600 Series

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: GLSL Ver: 1.50

Dec 29, 2010 5:45:15 PM com.jme3.system.lwjgl.LwjglTimer <init>

INFO: Timer resolution: 1000 ticks per second

Dec 29, 2010 5:45:15 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize

INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, OpenGL20, OpenGL21, OpenGL30, ARBprogram, GLSL100, GLSL110, GLSL120, GLSL130, GLSL140, GLSL150, VertexTextureFetch, TextureArray, TextureBuffer, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, TextureCompressionLATC, MeshInstancing, VertexBufferArray]

Dec 29, 2010 5:45:15 PM com.jme3.asset.DesktopAssetManager <init>

INFO: DesktopAssetManager created.

Dec 29, 2010 5:45:15 PM com.jme3.renderer.Camera <init>

INFO: Camera created (W: 640, H: 480)

Dec 29, 2010 5:45:15 PM com.jme3.renderer.Camera <init>

INFO: Camera created (W: 640, H: 480)

Dec 29, 2010 5:45:15 PM com.jme3.input.lwjgl.LwjglMouseInput initialize

INFO: Mouse created.

Dec 29, 2010 5:45:15 PM com.jme3.input.lwjgl.LwjglKeyInput initialize

INFO: Keyboard created.

Dec 29, 2010 5:45:15 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initialize

INFO: Audio effect extension version: 1.0

Dec 29, 2010 5:45:15 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initialize

INFO: Audio max auxilary sends: 2

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Gui Node)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (Statistics View)

Dec 29, 2010 5:45:16 PM com.jme3.scene.Node attachChild

INFO: Child (Statistics View) attached to this node (Gui Node)

Dec 29, 2010 5:45:16 PM com.jme3.asset.DesktopAssetManager loadAsset

WARNING: Cannot locate resource: dependencies/1280783806_1_GEI8.jpg/F/MIP

Dec 29, 2010 5:45:16 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at RayTest.October2010.CleanTestPhysicsCar.setupFloor(CleanTestPhysicsCar.java:177)

at RayTest.October2010.CleanTestPhysicsCar.simpleInitApp(CleanTestPhysicsCar.java:149)

at com.jme3.app.SimpleBulletApplication.initialize(SimpleBulletApplication.java:261)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:134)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:183)

at java.lang.Thread.run(Thread.java:636)

[/java]

I suppose that confusion is with classloaders. For sake of experiment, try registering location of unpacked resources with

assetManager.registerLocator("/path/to/your/files", FileLocator.class);

and see if it works.



If you can locate a classloader which can see the textures, try to register it as context classloader for thread you are doing resource loading from (using Thread.currentThread().setContextClassLoader(…)). It should then allow default assetManager to locate the resources properly.

Well, that is over my head with the classloaders. As far as the assetManager path, I tried the full path to the resource with no change in results. Setting that particular image on the texture is actually going to be one of the dynamic things the user will select before running the program.



Basically, I feel that if I could just compile and run the thing from the terminal, I could figure out the rest of the problem. That is where my problem currently resides. I simply cannot run it from the terminal because of that texture problem. I have o classLoaders currently in the program at all.