Linux + jme2(svn) + jmePhysics(svn)

Hi,



I am new to jme, I had not much trouble compiling.

Tho I had to create some bash scripts to help it get running.

If too many things get changed they may stop working or just get useless of course :).

Btw, if you easly ran from terminal, I would like to know what commands you used (probably “ant -something…”, I guess…).





INSTRUCTIONS (commands to execute on terminal):



cd $HOME/workspace

mkdir jme2

cd jme2



cat >.jars.sh


#!/bin/bash

#strPath=`pwd`"/jmonkeyengine-read-only/lib"
strPath=`pwd`

astr=(`find $strPath -iname "*.jar" |grep -v "macosx" |grep -v "windows"`)
for(( i=0; i<${#astr[*]}; i++)); do
  if((i>0));then
    str="$str:"
  fi
  str="$str${astr[i]}"
done
echo "$str"



cat >.javaLibraryPath.sh


#!/bin/bash

echo
`pwd`"/jmonkeyengine-read-only/lib/lwjgl/native/linux:"
`pwd`"/jmephysics-read-only/impl/ode/lib"



cat >jmonkeyengine-TestChooser.sh


#!/bin/bash

strJars=`./.jars.sh`
strJLP=`./.javaLibraryPath.sh`

# download
if [[ ! -d "jmonkeyengine-read-only" ]]; then
  svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/ jmonkeyengine-read-only
fi

# build
cd jmonkeyengine-read-only
if [[ ! -f "./build/jmetest/TestChooser.class" ]]; then
  ant compile-test #will compile jme and test
  ant dist-all
fi

# run
cd build
java
  -Djava.library.path=$strJLP
  -cp "./:$strJars"
  jmetest/TestChooser



cat >jmephysics-TestChooser.sh


#!/bin/bash

strJars=`./.jars.sh`
strJLP=`./.javaLibraryPath.sh`

strJME2path=`pwd`"/jmonkeyengine-read-only/build"
strODEpath=`pwd`"/jmephysics-read-only/impl/ode/classes"

# download
if [[ ! -d "jmephysics-read-only" ]]; then
  svn checkout http://jmephysics.googlecode.com/svn/trunk/ jmephysics-read-only
fi

# build
cd jmephysics-read-only
if [[ ! -f "./classes/com/jmetest/physics/TestChooser.class" ]]; then
  cd ant
  ant -lib ../../jmonkeyengine-read-only/build
  ant release.all
  cd ..
fi

# run
cd classes
if [[ ! -f "properties.cfg" ]]; then
  cp "$strJME2Path/properties.cfg" ./
fi
java
  -Djava.library.path=$strJLP
  -cp "./:$strODEpath:$strJME2path:$strJars"
  com.jmetest.physics.TestChooser



#each will svn download (if needed), compile (if needed), and run
./jmonkeyengine-TestChooser.sh
./jmephysics-TestChooser.sh

# to prepare them to work with eclipse just do this:
cd ..
ln -s jme2/jmephysics-read-only
ln -s jme2/jmonkeyengine-read-only

#echo "gook luck!  :D"

…or just "ant" in a console in the directory where your build.xml is. :wink:



Hi,



Yep, I tried some times.



Just “ant”, only builds here.



Then I found (grep target build.xml -i |grep -v “/target”) that it would be:

  ant run-testchooser



And it compiles and runs the test dialog,

but after I choose the test and click “ok” I get this:



...
run-testchooser:
     [java] 26/08/2008 00:54:46 jmetest.TestChooser start
     [java] INFO: Composing Test list...
     [java] 26/08/2008 00:54:46 jmetest.TestChooser find
     [java] INFO: Searching for Demo classes in "jmetest".
     [java] 26/08/2008 00:54:46 com.jme.scene.Node <init>
     [java] INFO: Node created.
     [java] 26/08/2008 00:54:46 com.jme.scene.Node <init>
     [java] INFO: Node created.
     [java] 26/08/2008 00:55:17 com.jme.app.BaseGame start
     [java] INFO: Application started.
     [java] 26/08/2008 00:55:17 com.jme.system.PropertiesGameSettings <init>
     [java] INFO: PropertiesGameSettings created
     [java] 26/08/2008 00:55:17 com.jme.system.PropertiesGameSettings load
     [java] WARNING: Could not load properties. Creating a new one.
     [java] 26/08/2008 00:55:17 class jmetest.effects.cloth.TestCloth start()
     [java] SEVERE: Exception in game loop
     [java] java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
     [java]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
     [java]     at java.lang.Runtime.loadLibrary0(Runtime.java:823)
     [java]     at java.lang.System.loadLibrary(System.java:1030)
     [java]     at org.lwjgl.Sys$1.run(Sys.java:72)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
     [java]     at org.lwjgl.Sys.loadLibrary(Sys.java:81)
     [java]     at org.lwjgl.Sys.<clinit>(Sys.java:98)
     [java]     at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
     [java]     at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(LWJGLPropertiesDialog.java:682)
     [java]     at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:231)
     [java]     at com.jme.app.BaseGame.start(BaseGame.java:64)
     [java]     at jmetest.effects.cloth.TestCloth.main(TestCloth.java:81)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at jmetest.TestChooser.start(TestChooser.java:465)
     [java]     at jmetest.TestChooser.main(TestChooser.java:444)
     [java] 26/08/2008 00:55:17 com.jme.app.BaseSimpleGame cleanup
     [java] INFO: Cleaning up resources.
     [java] 26/08/2008 00:55:17 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
     [java] INFO: LWJGL Display System created.
     [java] 26/08/2008 00:55:17 com.jme.app.BaseGame start
     [java] INFO: Application ending.

BUILD SUCCESSFUL
Total time: 58 seconds



That means LWJGL ".so" linux library was not automatically found.

So I tried this command:
  ant -lib lib/lwjgl/native/linux run-testchooser
and I got the same error.

1 - At build.xml I saw ant knows about linux, but it just doesnt seem to put this option "-Djava.library.path=lib/lwjgl/native/linux" when running.
2 - Also, "ant run-testchooser" is recompiling everything every time, could avoid it to speed up :).


After backup, I played a bit with build.xml in an attempt to make it know about linux native libs, but I did not succed... YET! xD

I'm not completely sure what ur asking but i do know eclipse has svn integration although I can't remember if it was a plug-in or it already had it. I was successfully able to do everything i needed to set myself up in eclipse both on my windows and kubuntu partian