Martin Apolses
Martin Apolses

Reputation: 47

Java mysql Error: Could not find or load main class lib\mysql-connector-java-5.1.25-bin.jar

My screen:

http://gyazo.com/b5e94029c8356c693f8ce51bed98f97a.png


And Lib folder:

http://gyazo.com/a521f4b3bf3b1623fd3cc2ec6aa94705.png

This is my run.bat:

@echo off
title Tracer
"C:\Program Files (x86)\Java\jdk1.7.0\bin\java"  -Xmx256m -cp bin; lib\mysql-connector-java-5.1.25-bin.jar Mains
pause

Mains.java is located in src, and is findable.

What is the problem?, Trying to install mysql for the first time!

Upvotes: 0

Views: 1444

Answers (1)

rgettman
rgettman

Reputation: 178253

Your -cp argument needs to be without spaces. Change

-cp bin; lib\mysql-connector-java-5.1.25-bin.jar

to

-cp bin;lib\mysql-connector-java-5.1.25-bin.jar

The error message indicated that your class path was treated as just "bin;" and the other part (the path to the jar) was treated as the class to run.

Shells and the Windows command prompt usually treat spaces as separators between arguments, which is why removing the space is recommended here.

Upvotes: 1

Related Questions