Java Exception Occured Help

30 ビュー (過去 30 日間)
Savannah Morrissey Martin
Savannah Morrissey Martin 2018 年 7 月 24 日
回答済み: Nikilesh Chilkuru 2018 年 7 月 26 日
I am trying to connect to SQL through Matlab and my command is
conn = getDBconnection([server name]);
and I am getting the following error:
Error using database (line 158)
Java exception occurred:
java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver : Unsupported major.minor version 52.0
Has anyone seen this?

回答 (1 件)

Nikilesh Chilkuru
Nikilesh Chilkuru 2018 年 7 月 26 日
The major.minor version 52.0 indicates that the java code you are using has been compiled using Java 8 compiler. For more information on major.minor version numbers refer http://www.rgagnon.com/javadetails/java-0544.html
Java code compiled by a compiler of a particular version can only be executed by java runtimes of that version or newer versions. To check which version of java, MATLAB is using run this command in MATLAB command prompt:
>>version -java
The Error: " java.lang.UnsupportedClassVersionError " is being raised because of the incompatibility between the compiled JAR and the run time java being used by MATLAB. Just make sure you are using a compatible runtime (which is Jre8 or higher in your case).

カテゴリ

Help Center および File ExchangeJava Package Integration についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by