How can I use a Java jar file in a Grails application?
Wednesday, February 10th, 2010After banging my head against the wall in trying to find out how I can use Java class in a Grails application I found out that the solution is embarrassing simple.
Just create a jar file from your Java classes and put the jar file into the folder “jar” of your Grails application.
You also have to add the correct import statement to your Groovy file. E.g. if you want to use class “MyJavaClass” in package “de.vogella.test” you have to add “import de.vogella.test.MyJavaClass” to your Groovy class.
You also need to re-start the grails server.
To learn more about Grails see Grails Tutorial