Running the Ant demo classes

Started by arkiruthis, November 28, 2015, 15:41:44

Previous topic - Next topic

arkiruthis

Hi everyone,

No problems building the library with Ant, but I'm a bit confused about how the examples are run from Ant?

The build instructions list the following:
ant demo -Dclass=<demo class> ââ,¬â€œ Runs one of the LWJGL demos in the test module

However, I don't see a list of available options for <demo class>

I've looked in the following folder
bin/Tests/org/lwjgl/demo

and found various folders containing classes with names like "Mandelbrot" etc.,

but no variation on the class (with or without extension) runs the demo.
e.g,
[Demo] Error: Could not find or load main class Mandelbrot.class


spasi

You must use the full classpath, for example:

ant demo -Dclass=org.lwjgl.demo.glfw.Gears


A list of available demos does not exist, but you can have a look in modules/core/src/test/java/ for classes with a main method. Most demos are a single class, but some are more complex. For example, to run the OpenCL Mandelbrot demo:

ant demo -Dclass=org.lwjgl.demo.opencl.CLGLInteropDemo


You can also pass JVM arguments with (horrible, I know):

ant demo -Dclass=org.lwjgl.demo.opencl.CLGLInteropDemo -Djvmargs="-Dorg.lwjgl.util.Debug=true"

arkiruthis

Fantastic, thank you so much spasi! Coming from c++ I'm a bit rusty on Java and forgot about the fully qualified package names.

The demos now work great. :)