I want to simplify my execution of a Groovy script that makes calls to an Oracle database. How do I add the ojdbc jar to the default classpath so that I can run:
groovy RunScript.groovy
instead of:
groovy -cp ojdbc5.jar RunScript.groovy
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Summarized from Groovy Recipes, by Scott Davis, Automatically Including JARs in the ./groovy/lib Directory:
.groovy/libin your login directoryUncomment the following line in ${GROOVY_HOME}/conf/groovy-starter.conf
load !{user.home}/.groovy/lib/*.jarCopy the jars you want included to
.groovy/libIt appears that for Groovy 1.5 or later you get this by default (no need to edit the conf), just drop the jars in the /lib dir.