Results 1 to 3 of 3

Thread: Add jars to the classpath in a Grails project

  1. #1
    Join Date
    Mar 2012
    Posts
    1

    Default Add jars to the classpath in a Grails project

    Hi all,

    I'm new to STS and I'm developing a semantic web search. I am using STS 2.9.0 and Grails 2.0.1 on WIndows 7.
    I have to add the jdbs4sparql driver to the classpath. As usual: Project->Builth path->Configure builth path-> add Jars.
    Is this enough to add the jars to the classpath? I can see all the Jars I have added in the .classpath file. But I get a ClassNotFoundException: the 0rg.lexicon.jdbc4sparql.SPARQLDriver was not found.
    Should I see them in the Grails Dependencies too?

    This is my code where I use this driver:
    def db=[url:'jdbc:sparql:http://dbpedia.org.sparql',drive...QLDriver']

    I hope someone can help me...
    Last edited by Talena; Mar 10th, 2012 at 06:11 AM.

  2. #2
    Join Date
    Jul 2007
    Posts
    123

    Default

    Adding to the STS classpath has no effect on the Grails application - STS manages its dependencies from what it finds in the Grails project. You can put jars in the lib directory but you need to run "grails compile --refresh-dependencies". Then in STS run Grails Tools | Refresh Dependencies to get it back in sync with Grails.

  3. #3
    Join Date
    Mar 2012
    Posts
    1

    Default works like a dream

    Thanks for the tip. I was struggling with this. I was stuck with the STS IDE, tried adding to build path, moving to WEB-INF/lib, upgraded STS to beta version from the nightly update server, modifed Config.groovy file, etc....

    However, I just needed to run the command suggested by burtbeckwith

    thanks for this.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •