简体   繁体   中英

Eclipse and Classpath

I swear I'm going insane.

JDeveloper runs my project with not a single complaint.

If I do "java -cp /usr/share/java/mysql.jar:. MAIN.java", it works like a charm.

But Eclipse says "[ censored ] you" and ignores my classpath settings.

I open the Run > Run... menu, and add the mysql jar in the classpath tab, but time and time again, I keep getting "No suitable driver found".

Now, I shouldn't have to add the jar to the build path ---otherwise, what's the point of using JDBC if I'm gonna rebuild if I wanna change the engine---. Nor should I have to do " Class.forName() ", which I don't need in the other ways to run it.

A hand, in this insanity?

Sure, just set your JRE to the proper Java6 one, instead of relying on Eclipse's autoconfig.

Yes, I'm talking to myself.

尝试在“运行”对话框中将jar作为命令行参数添加。

That is not how I normally add jars to an eclipse project. Try following the steps in this Wiki .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM