我得到一个 java.lang.classnotfoundexception: com.mysql.jdbc.Driver [英] I'm getting a java.lang.classnotfoundexception: com.mysql.jdbc.Driver

查看:32
本文介绍了我得到一个 java.lang.classnotfoundexception: com.mysql.jdbc.Driver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么会收到这个错误?检查图片:

How come I get this error? Check the picture:

我在普通 java 项目(不是 android 项目)上使用了相同的 jar,它曾经可以工作.怎么了?

I used the same jar on normal java projects(not android ones) and it used to work. What's wrong?

推荐答案

您收到 NoClassDefFoundError 因为您的 jar 文件在运行时不可用.为了使其在运行时可用,您必须在您的 java 构建路径中选中 jar 文件上的复选框,如下所示:

You're getting a NoClassDefFoundError because your jar file is not available at runtime. In order for it to be available at runtime you'll have to check the checkboxes on your jar file in your java build path like so:

这篇关于我得到一个 java.lang.classnotfoundexception: com.mysql.jdbc.Driver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆