views:

2233

answers:

5

I am just getting started with Groovy on Grails. How do I add Java libraries to my Grails project? I added the Smack library jar to the lib folder of my Grails project, but I still cannot import any of its packages into my Java or Groovy classes. I am using the Netbeans IDE. Any help would be appreciated..

Buzzy

+3  A: 

This is a know bug in NetBeans: http://www.netbeans.org/issues/show_bug.cgi?id=144243

Maybe you can help the devolpers to fix it by adding a comment to this issue in the NetBeans bug tracker.

This issue is said to be fixed in NetBeans 6.5RC2. I didn't have the time to check it, though.
I am using NetBeans 6.5RC2
Buzzy
+1  A: 

As stated above, this is a bug in the IDE, not Grails. Those libraries are available in your code, but the IDE won't do any code completion, etc.

Note, NetBeans 6.5 is supposed to have much better Grails integration. Or, you could use IntelliJ, which already has it.

G2One's acquisition by Spring Source makes the roadmap for Eclipse integration for Grails look much rosier, too. It's not there yet, but it's coming, and now maybe faster than we thought.

Bill James
A: 

The issue still remains in NetBeans 6.5 (Build 200811100001), so the IDE will not do any code completion and formats the code that is referencing classes in the JAR as erroneous.

I have not tried NetBeans 6.7.

njebert
A: 

I'm using Netbeans 6.7. I just pasted the library in the project's 'lib' folder and when I went back to Netbeans the library was under the 'Libraries' folder automagically!

A: 

i m also using netbean 6.7 and it's automagically working when i passed the jar under Libraries folder

lapinferoce