Question

I am just getting started with 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

Was it helpful?

Solution

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.

OTHER TIPS

Here is what I did to solve the problem when running SpringSource Toolsuite:

  1. Configure the build path by adding external jars (e.g. javax.mail, adwords-api, etc.)

  2. Imported the same jars in to the lib folder (where mysql connector jar is located).

This should fix the compile time errors you would receive from missing imports in your java files.

Hope this helps

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.

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.

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!

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top