我在 Java 7 的 netbeans 中使用 Exhange Web Service Java 插件,
代码
ExchangeService service = new
ExchangeService(ExchangeVersion.Exchange2007_SP1);
ExchangeCredentials credentials = new WebCredentials
("domain\\user","pass");
service.setCredentials(credentials);
service.autodiscoverUrl("email");
我正面临这个错误
java.lang.UnsupportedClassVersionError: microsoft/exchange/webservices/data/ExchangeCredentials : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: TestMail.ews.TestJavaMail. Program will exit.
Exception in thread "main" Java Result: 1
我试图将设置项目-> 属性-> 源选项卡-> 源/二进制组合框更改为 JDK 5。仍然给我错误
- 如何修复此错误?
- 我第一次使用 ews 来阅读来自 ms Exchange 网络服务的电子邮件,有人可以建议我一些示例/教程来完成我的任务吗?
谢谢,如果需要,我很乐意提供更多信息。