JavaExec and FileCollection

I need to run a Java class at the end of my build. This is an externally provide jar with dependency on a second jar.

My understanding is that JavaExec starts a separate JVM to run the jar. Looking at the parameters I am getting confused. The parameter ‘classpath’ says ‘for executing the main class’.

The error message I am getting says that classpath expects a FileCollection. I can not work out how to make a FileCollection with 2 files. The documentation says you can use Project.files to do this but it doesn’t exist I get an Unresolved reference for files.

The documentation is not very easy to decipher, can anyone point me in the right direction?

I got there eventually:

	 	val collection = files("c:/Program Files/Moneydance3069/lib/Moneydance.jar","../lib/extadmin.jar")
 	 	 collection.forEach { println(it) }

There are so many different answers for this and it turns out to be trial and error

To create a file collection from two local files, you exactly found the right thing to use.
That files actually is Project.files.
If you tried to literally do Project.files this did not work as files is not a static method on Project, but a normal instance method.