Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0m2
-
Fix Version/s: 2.0.0RC1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
In the following code:
package pack2; def sub = new GroovySubClass() print sub.val() class GroovySubClass extends GroovyClass { public int val() { return 0; } }
In file 2:
package pack2;
class GroovyClass { }
I run as a script and I get the following exception:
Caught: java.lang.LinkageError: loader constraints violated when linking groovy/lang/MetaClass class at pack2.ScriptTesting.class$(ScriptTesting.groovy) at pack2.ScriptTesting.$get$$class$pack2$GroovySubClass(ScriptTesting.groovy) at pack2.ScriptTesting.run(ScriptTesting.groovy:5)
This works fine when run as a Groovy or Java App. I wonder if I need to add the project onto the classpath.
Interestingly, when I delete the .class files from the bin directory corresponding to all groovy files being used in the execution of the program (but class files from Java files must remain), the program can run.
So, class files coming from groovy files (excepting the target script, which seems to be ignored) must be excluded from the execution.
How to make this happen? Any way around that?