I’m trying to use groovyc, but something is not right:
>echo println("Hello world") > test.groovy
>groovy test.groovy
Hello world
>groovyc test.groovy
>java -cp C:\utils\groovy-1.8.1\embeddable\groovy-all-1.8.1.jar test
Error: Could not find or load main class test
>dir test.class
...
11/10/2011 02:54 PM 7,104 test.class
What am I missing?
When you specify the classpath with
-cpswitch, its default value (current directory) is overwritten and so JVM can’t find your class.Add current directory to classpath, and everything works: