GroovyJ 0.1.2 compatible with #3405?

I'm asking because I've been trying to use the plugin for the first time,
but all I get
from Run is:

java.lang.ClassNotFoundException: groovy.lang.GroovyShell
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:83)
Exception in thread "main"

..even on a "hello world" script

- Richard





5 comments
Comment actions Permalink

Hi Richard,

Yes, GroovyJ 0.1.2 is compatible with Irida builds #3386 through to #3408.

The error you describe indicates that you tried running a Groovy script belonging to a module that does not have the required Groovy JARs in its classpath.

If that's the case, you will need to check that:

1) the run configuration that was created for that script uses the JDK and classpath of the associated module

2) the selected module depends on the default Groovy runtime (which should have been automatically installed as a global library)

The default Groovy runtime is automatically added to modules created after installing the plug-in.

Regards,

Franck

0
Comment actions Permalink

Hello Franck,

Ah, so if the project pre-dates the re-installion of Groovy 0.1.2 (update
didnt work) then I need to check the global library is selected in the Paths
tab. Thats all I needed to know, odd plugin requirement.

Thanks,

- Richard




0
Comment actions Permalink

Hi Richard,

Thanks for your interest in GroovyJ. I'm interested to hear how you would expect the plug-in to behave for old/new projects.

Looking forward to your feedback!

Regards,

Franck

0
Comment actions Permalink

Hello Franck,

Hi Richard,

Thanks for your interest in GroovyJ. I'm interested to hear how you
would expect the plug-in to behave for old/new projects.


I just seemed odd that I needed to activate the groovy runtime, not sure
whether IDEA would
let you add the groovy runtime jars to its own internal IDE classloader..
plugins classloader?
then have groovy pickup on the project classpath via its own mechanisms.
You're bound to
know much more about the internals than I. Guess its just a new type of plugin,
a language extension. Another thing that caught me out initially was loading
an external (to project) groovy script
demanded a module setting before it'd run.. wondered if there was demand
for a default global (normal groovy) module setting? not all my scripts will
be related to the project.

Speaking of which should I remove the old groovy syntax file (pre-plugin)
I have on my config
directories? Just noticed Im not getting code completion on new File().each..
etc..?

Initial feeling is moving between a Java editor and a groovy one is still
a real wrench at the moment,
especially if you've unknowingly become dependant on all the IDEA goodies,
automatic imports, jump
to code, command completion etc..

- Richard


0
Comment actions Permalink

Hi Richard,

+

I just seemed odd that I needed to activate the groovy runtime, not sure
whether IDEA would let you add the groovy runtime jars to its own internal
IDE classloader.. plugins classloader? then have groovy pickup on the
project classpath via its own mechanisms.

+

Wouldn't what you describe be too intrusive? Also, given that Groovy itself hasn't reached 1.0 and is still subject to change, having a default runtime automatically installed (and upgraded) as a global library gives users the possibility of defining other global libraries for other versions of Groovy.

+

Another thing that caught me out initially was loading an external (to project)
groovy script demanded a module setting before it'd run.. wondered if there was
demand for a default global (normal groovy module setting? not all my scripts
will be related to the project.

+

The module settings are needed to provide a Groovy runtime for running scripts, just as global (or project) libraries can be declared as module dependencies for running Java applications and JUnit tests.

+

Speaking of which should I remove the old groovy syntax file (pre-plugin)
I have on my config directories? Just noticed Im not getting code completion
on new File().each.. etc..?

+

Installing GroovyJ automatically registers *.groovy, *.gsh, *.gvy, *.gy as file extensions for Groovy scripts. This has the effect of making the old syntax file irrelevant and ignored by IDEA. Feel free to remove it if you wish.

+

Initial feeling is moving between a Java editor and a groovy one is still
a real wrench at the moment, especially if you've unknowingly become dependant
on all the IDEA goodies, automatic imports, jump to code, command completion
etc..

+

Agreed, we feel the pain too! Those goodies are the next planned features. Work is underway to implement IDEA's PSI for Groovy. However, this is a rather large piece of work that may not be completed for some time.

Regards,

Franck

0

Please sign in to leave a comment.