Java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver On Android

帅比萌擦擦* 提交于 2019-12-05 08:30:48

I had the same problem with my Android app in Eclipse. What worked for me was to export the external jars with my app.

If you have already added the jtds-1.2.5 driver, good. Otherwise:

Right click on the Project > Properties > Libraries Tab Add the jtds-1.2.5.jar file by clicking on "Add External JARs"

Next, in the Order and Export tab (Right next to Libraries in the Java Build Path window) check the box for jtds-1.2.5.jar (and any other external jars you might have).

This will export the .jar containing the driver with the .apk file.

If you are using eclipse, Try this steps

  • Right click on your project
  • Click Build Path > Configure Build Path...
  • Choose Libraries tag and click Add External JARs...
  • Point your jtds.jar and click OK.
  • Rebuild and run again.
Andy Res

If you use a third party library, make sure you have all its required dependencies, if it requires any.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!