本文介绍了在Raspberry Pi的类路径中添加JDBC驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将JDBC驱动程序添加到树莓派上的Java程序的类路径中?当我去在树莓派板上编译该类时,该类应该正确编译,就像在没有驱动程序存在时那样,它只会给出错误.我的班级叫做checker.java它使用jdbc!
How do I add the JDBC driver to the class path on a java program I have on my raspberry pi? The class should compile correctly when I go to compile it on the raspberry pi board it just gives the error like it would when there is no driver present.My class is called checker.javaand it uses jdbc!
推荐答案
例如,如果您在文件夹中,则同时具有.java和.jar文件:
For example, if you are in folder, where you have both your .java and .jar files:
javac -cp "jdbcdriver.jar" checker.java
顺便说一句,类名必须以大写字母开头.
By the way, class names must start with uppercase letter.
UPD:您应该以相同的方式运行程序
UPD:You should run your program the same way
java -cp "jdbcdriver.jar" checker
这篇关于在Raspberry Pi的类路径中添加JDBC驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!