Buzzy
Buzzy

Reputation: 3677

Add Java Libraries to a Netbeans Grails Project

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

Upvotes: 8

Views: 10560

Answers (6)

simon
simon

Reputation: 41

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

Upvotes: 4

lapinferoce
lapinferoce

Reputation: 23

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

Upvotes: 0

_nt
_nt

Reputation:

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!

Upvotes: 0

njebert
njebert

Reputation: 544

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.

Upvotes: 0

billjamesdev
billjamesdev

Reputation: 14640

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.

Upvotes: 1

lutz
lutz

Reputation:

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.

Upvotes: 4

Related Questions