I am coding on a hacked client for Minecraft and I have a feature which includes MySQL. When I start my client in eclipse it works fine but everytime when I export and start my client there was this error: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
. I already added the mysql-connector to my external jars in eclipse but the exported jar doesn't find the driver. Many thanks in advance, TheRealLenni.
Asked
Active
Viewed 350 times
0

TheRealLenni
- 43
- 1
- 4
-
Possible duplicate of [Connect Java to a MySQL database](https://stackoverflow.com/questions/2839321/connect-java-to-a-mysql-database) – Nico Haase Mar 15 '19 at 13:54
-
Please do not make hacked clients. That is in violation of the Minecraft EULA and is illegal. – Draco18s no longer trusts SE Mar 16 '19 at 01:27
-
1) Please do not make hacked clients, as this behaviour violates the Mojang EULA. 2) In order to do this, you need to actually compile the jar with the client, just drag and drop the jar contents into your compiled jar, and it should work – Frontear Mar 16 '19 at 12:15
-
@Draco18s I dont really make a hacked client... more a client which has a better design and a few features but no hacks... something like LabyMod... – TheRealLenni Mar 17 '19 at 07:54
-
LabyMod is a *mod* not a *client.* "Hacked client" is a very specific thing and completely and utterly distinct from "modded client." – Draco18s no longer trusts SE Mar 17 '19 at 16:07
1 Answers
0
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
means, that the class com.mysql.cj.jdbc.Driver
is not found at runtime. A common mistake is, that you have added the library containing the class com.mysql.cj.jdbc.Driver
as dependency, but the library does not get exported with your plugin. So, make sure, that when you export your plugin, the library containg the class com.mysql.cj.jdbc.Driver
is also included in the resulting jar file.

Marvin Klar
- 1,869
- 3
- 14
- 32