简体   繁体   English

Java mysql错误:找不到或加载主类lib \\ mysql-connector-java-5.1.25-bin.jar

[英]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: 和Lib文件夹:

http://gyazo.com/a521f4b3bf3b1623fd3cc2ec6aa94705.png

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.

相关问题 为什么我得到“错误:无法找到或加载主 class mysql-connector-java-8.0.19.jar”? - Why I get “Error: Could not find or load main class mysql-connector-java-8.0.19.jar ”? 错误:无法找到或加载主 class mysql-connector-java-8.0.23.jar:为什么? - Error: Could not find or load main class mysql-connector-java-8.0.23.jar : Why? 找不到文件mysql-connector-java-5.1.13-bin.jar - Could not find file mysql-connector-java-5.1.13-bin.jar Java JAR:无法找到或加载主 class - Java JAR: Could not find or load main class Java -jar错误:找不到或加载主类 - Java -jar ERROR: could not find or load main class Ubuntu Java -jar错误:找不到或加载主类 - Ubuntu Java -jar error: Could not find or load main class 我得到的错误检查 Apache Pig 版本“错误:无法找到或加载主类 C:\\java\\lib\\tools.jar” - The error I get Which checking Apache Pig Version "Error: Could not find or load main class C:\java\lib\tools.jar" 错误:在具有mysql-connector-java-5.0.7-bin的JAR中 - Error: in JAR with mysql-connector-java-5.0.7-bin Java-错误:找不到或加载主类 - Java - Error: Could not find or load main class 错误:找不到或加载主类(在Java 8中) - Error: Could not find or load main class ( in Java 8)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM