Eclipse和Classpath [英] Eclipse and Classpath
问题描述
我发誓我会疯了。
JDeveloper运行我的项目,没有一个投诉。
如果我做java -cp /usr/share/java/mysql.jar :.MIN.java,它的作用就像一个魅力。
但Eclipse说打开Run> Run ...菜单,然后将mysql jar添加到[类路径选项卡,但一次又一次,我不断得到找不到合适的驱动程序。
现在,我不必将jar添加到构建路径---否则,如果我想改变引擎,我将要重建什么是使用JDBC?也不应该做 Class.forName()
,我不需要其他方式来运行它。
一个手,在这个疯狂?
当然,只要将你的JRE设置为正确的Java6,而不是依赖Eclipse的autoconfig。
是的,我在和自己说话。
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.
这篇关于Eclipse和Classpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!