Add Java Libraries to a Netbeans Grails Project

10,518

Solution 1

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

Solution 2

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.

Share:
10,518
user239546
Author by

user239546

Buzzy is Good, Buzzy is Wise

Updated on June 20, 2022

Comments

  • user239546
    user239546 almost 2 years

    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