I would like to use 'Ant' to compile and create the '.jar' of my project.But I can not properly integrate the LWJGL library, I wonder what I should put in the 'Ant task' which I use at compile time, the launch and creation of the executable file ('.jar').

1) You need to include the lwjgl jars in the "projectClasspath":<path id="projectClasspath"> <pathelement location="path/to/lwjgl.jar"/></path>2) You need to add -Djava.library.path to point to the lwjgl native files in the run task:<java....>...<jvmarg value="-Djava.library.path=./lib"/></java>

tom is right. Your run task must set both the Java library path and the class path. If you want, I can show you an example of script doing the same thing, I just need to adapt it for LWJGL. In mine, I use several tasks to create the JAR, sign all JARs, create the JNLP file, run the game, etc...

You need to use some conditions to build the Java library path correctly whatever the OS and the architecture. I did it and it works fine

Using a single JAR file is a bad idea because double clicking on it rarely run the application because of WinRAR, Ark, etc... Do as you wish but applets and Java Web Start are more reliable. Maybe you can set the Java library path in the manifest.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org