[英]Java mysql Error: Could not find or load main class lib\mysql-connector-java-5.1.25-bin.jar
My screen: 我的萤幕:
And Lib folder: 和Lib文件夹:
This is my run.bat: 这是我的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. Mains.java位于src中,并且可以找到。
What is the problem?, Trying to install mysql for the first time! 有什么问题?,尝试首次安装mysql!
Your -cp
argument needs to be without spaces. 您的-cp
参数必须没有空格。 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;" 该错误消息表明您的类路径仅被视为“ bin;”。 and the other part (the path to the jar) was treated as the class to run. 另一部分(jar的路径)被视为要运行的类。
Shells and the Windows command prompt usually treat spaces as separators between arguments, which is why removing the space is recommended here. Shell和Windows命令提示符通常将空格视为参数之间的分隔符,这就是为什么建议此处删除空格的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.