简体   繁体   中英

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

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.

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

  1. Configure the build path by adding external jars (eg 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.

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!

即时通讯也使用netbean 6.7,当我在Libraries文件夹下传递jar时,它会自动运行

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM