How to use jme .jar files in eclipse

hi,



I am really a newbea and couldn't understood how to use jme .jar files in my java projects with eclipse. I have created the .jar files by following the installation article in http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme but couldn't succeed using them by following the same article. I really appriciate if someone does a favour by explaining it more clearly.



Thanks…

You might consider going through some Eclipse specific tutorials first before adding jME to the mix.  jME can be somewhat complicated with the native libraries and all so it would be helpful if you have a good understanding of basic development in Eclipse before trying to tackle it in my opinion.

where are you stuck? on which step? are you trying to build jme as a project in Eclipse? or you have your own project and just want to use the jars?

are you getting errors when trying to run your test app? make sure you set your VM parameters accordingly…

Every JAR file of the jME, LWJGL and other needed Java libraries must be added to the Build Path (reachable with a right click, or control click in Mac OS, on the project icon, or trough the project preference window). Also, for each Java library (for example lwjgl.jar), that uses native libraries, you must set native path (=the place where you have native libraries: Windows using *.dll, Linux using *.so, and Mac OS using *.dylib extension, that in jME CVS are in the ./lib directory). This can be done for each Java library or adding once a Java runtime option in the Run… window. This option is -Djava.library.path=./lib (without quotes). For multiple paths just use ; under Windows and : under *nix as a separator.

if you actually use eclipse 3.2, the visual guide is all what you need(if you follow the steps you can’t do anything wrong). also take a look at mark’s note about the native libraries. if you set that once, you won’t need the -Djava.library.path anymore.

Ender said:

Every JAR file of the jME, LWJGL and other needed Java libraries must be added to the Build Path (reachable with a right click, or control click in Mac OS, on the project icon, or trough the project preference window). Also, for each Java library (for example lwjgl.jar), that uses native libraries, you must set native path (=the place where you have native libraries: Windows using *.dll, Linux using *.so, and Mac OS using *.dylib extension, that in jME CVS are in the ./lib directory). This can be done for each Java library or adding once a Java runtime option in the Run... window. This option is `-Djava.library.path=./lib` (without quotes). For multiple paths just use `;` under Windows and `:` under *nix as a separator.


Thanks for the info. I can now compile jme projects with jarred version of jme. I have also followed the tutorial about adding the api doc in jme.jar archive and created the .jar file with api doc but cant use the api doc inside eclipse. Do I need to enable it in some where?


Thanks.

Using API Documentation with Eclipse, works exactly like the configuration of Native libraries. In the Build Path settings window, you can expand the nodes corresponding to the Java libraries and for each of them you can set the path that points to the directory, JAR file or ZIP file, containing a valid API Documentation tree.