I have a simple java class:
package test;
class Hello {
public static void main(String[] args) {
System.out.println(\"Hi\");
}
}
on whi
Your class Hello
needs to be declared as public to be accessible from other packages. As a dynamic language, Groovy can't identify such errors and ends up looking for a variable named Hello
.
It's generally a bad idea to use wildcard imports; in this case, using import test.Hello;
would have given you a better error message.