Is there a way to execute a Groovy class by specifying the package with dots, as with java?
Example: File ./my/package/MyClass.groovy:
package my.package
class MyClass {
static void main(String[] args) {
println "ok"
}
}
> cd my/package my/package> groovy MyClass ok > cd ../.. > groovy my/package/MyClass.groovy ok > groovy my/package/MyClass ok > groovy my.package.MyClass Caught: java.io.FileNotFoundException: my.package.MyClass
I was expecting the last command to work. I tried various ways of setting the classpath, to no avail.