如何在Java 7中使用org.json Java库 [英] How to use the org.json Java library with Java 7

查看:176
本文介绍了如何在Java 7中使用org.json Java库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序中进行一些简单的JSON解析, Douglas Crockford库似乎正是我所需要的。

I need some simple JSON parsing in my application and the Douglas Crockford library seems exactly what I need.

但是,我似乎遇到了问题。我收到以下错误:

However, I seem to be running into a problem. I'm getting the following error:

线程main中的异常java.lang.UnsupportedClassVersionError:org / json / JSONObject:不支持的major。次要版本52.0

我搜索了一下,我得到的印象是这是由于某些版本不兼容。我试过改变Java版本,但似乎没有帮助。我在我的程序中使用Java 7和Java 7功能,最终我想使用Java 7.

I Googled around a bit and I get the impression that this is due to some version incompatibility. I've tried changing Java versions but it doesn't seem to help. I'm using Java 7 and Java 7 features in my program and ultimately I want to use Java 7.

如何解决此问题?

PS:我看过Jackson和GSON,绝对不想使用它们,所以请不要建议作为替代。

PS: I looked at Jackson and GSON and definitely don't want to use either so please don't suggest as an alternative.

推荐答案

您是否尝试过使用旧版本的软件包?

Have you tried using an older version of the package?

尝试: http://mvnrepository.com/artifact/org.json/json/20140107

这篇关于如何在Java 7中使用org.json Java库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆