如何解决VSCode中的ClassNotFoundException: com.mysql.cj,jdbc,Driver

问题描述 投票:0回答:0

我已经在 VSCode 中创建了一个 Java 项目。我已在参考库中提供了 JAR 文件位置。当我尝试运行代码时,它仍然显示 ClassNotFoundException。 我正在使用 MySQL 版本 8 的驱动程序,我的系统中有 MYSQL 版本 8,并且还使用 JDK 17。

我已经在参考库中给出了正确的路径,但仍然出现错误。 This is the reference Library and the already added JAR File This is the Code to load the Driver

我已经使用 Eclipse 创建了具有相同 Jar 文件的项目,但我想切换到 VsCode。 在 Eclipse 中,我还必须首先删除 module-info 文件。当我创建新项目时,我在 VsCode 中没有看到任何类似的文件。

java mysql jdbc classnotfoundexception java.lang.classnotfoundexception
© www.soinside.com 2019 - 2024. All rights reserved.