Search code examples
eclipsescalasbtliftdependency-management

Importing MySQL JDBC driver in lift


I'm trying to establish a database connection in my lift app using the mysql jdbc driver. I included the jar file in the eclipse build path, but building with importing the jar using import com.mysql._the app with sbt always throws the error:

object mysql is not a member of package com

Setting the classpath in the sdb.bat didn't help neither setting the system classpath variable.

set SCRIPT_DIR=%~dp0
java -Dscala.userjavacp=true -cp "%SCRIPT_DIR%\src\main\java\mysql.jar" -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx1024M -Xss2M -jar "%SCRIPT_DIR%\sbt-launch-0.12.1.jar" %*

Solution

  • SBT doesn't know anything about Eclipse build path. You need to add dependencies in the way SBT understands, e.g.:

    add jars to lib and they will be placed on the project classpath. Not much else to it!