问题描述
我已经安装了Java 6和7,并使用eclipse编写了一个简单的jdbc应用程序.我在lib文件夹中同时有sqljdbc4.jar和sqljdbc.jar.我收到此消息...
I've installed both java 6 and 7 and using eclipse to write a simple jdbc application. I have both sqljdbc4.jar and sqljdbc.jar in the lib folder. I'm getting this message...
严重:该驱动程序不支持Java Runtime Environment(JRE)1.7版.使用sqljdbc4.jar类库,该库提供对JDBC 4.0的支持.
SEVERE: Java Runtime Environment (JRE) version 1.7 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
线程主"中的异常java.lang.UnsupportedOperationException:该驱动程序不支持Java运行时环境(JRE)1.7版.使用sqljdbc4.jar类库,该库提供对JDBC 4.0的支持.
Exception in thread "main" java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.7 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
at com.microsoft.sqlserver.jdbc.SQLServerConnection.<init>(SQLServerConnection.java:304)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1011)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at sqldriver.doConnection(sqldriver.java:27)
at sqldriver.main(sqldriver.java:12)
如果我想使用1.6,我该怎么做?
If I'm suppose to be using 1.6 how would I go about doing that?
推荐答案
我明白了.
我需要更改运行/调试设置">编辑">执行"环境
I got it.
I needed to change the Run/Debug Settings > Edit > Execution environment
我去了.
这不是一个永久性的解决方法,但现在可以解决.
And there I go.
It's not a permanent fix but it will do for now.
这篇关于我如何使用不同版本的Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!