Jme+ netbeans on linux(ubuntu)

hi every one i have configured jme2 for my netbeans on linux…but i can't run my app …

it throws an exception…

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)

at java.lang.Runtime.loadLibrary()(Runtime.java:823)

at java.lang.System.loadLibrary(System.java:1030)

at org.lwjgl.Sys$1.run(Sys.java:72)

at java.security.AccessControler.doPrivilged(Native Method)

at org.lwjgl.Sys.doLoadLibrary(Sys.java:81)

at org.lwjgl.Sys.<clinit>(Sys.java:98)…



i have windows and ubuntu both on my machine…and in windows i don't face any problem…



my lwjgl path is:/usr/local/program/JME2/jME2/lib/lwjgl/native/linux



on netbeans:

–>in the projects–>properties–>run—>vm options—i have specified:-Djava.library.path="/usr/local/program/JME2/jME2/lib/lwjgl/native/linux"…



guys please help me out…my windows has been crashed…and i have to do my projects on jme…so pls help me out with dis problem



regards…

Looks like you have set up things correctly. Is there actually a file called liblwjgl.so in /usr/local/program/JME2/jME2/lib/lwjgl/native/linux? If not, you can try updating jME 2 from svn a few times and see if it shows up…

You could also print out the java.library.path (System.out.println(System.getProperty("java.library.path"))) to see if that is somehow messed up.

yeah…liblwjgl.so is there in the path u specified…

Have you done an ldconfig on the path to the .so files? Usually, for simplicity, I dump the .so files in /usr/lib and run ldconfig just to be sure. Always make sure never to overwrite different .so files of the same name in /usr/lib, that could break your system.

thanks scorpius…but i didn't get u …i m not familiar with idconfig…and i m not that much linux user so may be i dodn't know much about the linux environment…could u just elaborate bit…

hi everyone at last i made it…



previously i did this

on netbeans:

–>in the projects–>properties–>run—>vm options—i have specified:-Djava.library.path="/usr/local/program/JME2/jME2/lib/lwjgl/native/linux"…




actually i just removed the double quotes and it worked…so any one using netbeans on ubuntu( i m using 8.04…hardy heron), while setting path of lwjgl do not put double quotes…



thanks all…

Great you solved it, Padam!

I don't know if it can help, but I will tell here how I use it in my linux slackware 12:

to compile jME itself, a rely on the build.xml target as it is:

(the code below is taken from jME project build.xml)



<target name="run-testchooser" depends="compile-test" description="Runs the TestChooser">

<java classname="jmetest.TestChooser" fork="true" classpathref="classpath">

<jvmarg value="-Djava.library.path=${libs}" />

</java>

</target>



see the line jvmarg value="-Djava.library.path=${libs}" , libs is taken from:

    <property name="libs" value="./lib"/> found in file build-import.xml.

And that is all, works fine.



To run a project using jME, I put in properties:



-Djava.library.path=lib/



I have put all libs in a lib folder of my project. This way, it works fine in both linux and windows (I have not tested on mac, but I think it should work too). The native stuff is auto selected, I think :slight_smile:



I also keep an up to date folder in my project, distUtil, where I put lib jars and other stuff like images, etc. Then, I create a target in my project build.xml:



        <target name="-post-jar">

        <copy todir="dist">

          <fileset dir="distUtil"/>

        </copy>

        <!–copydir src="distUtil" dest="dist" / -->

        </target>



This way, I make sure the dist folder of my project will carry on a lib folder with all stuff needed to allow it run out of netbeans, both in linux and windows.



I hope it can be usefull …