您的位置:首页 > Web前端 > JavaScript

Json lib 抛出 NestableRuntimeException

2015-07-09 16:25 543 查看
 JSONObject 的使用

项目中导入了 json-lib 包,但是在运行如下代码的时候还是出现了如下错误,究其原因是因为缺包,缺了如下5个包:

commons-beanutils-1.8.3

commons-lang-2.6 (注:导入最新的
3.1 版本会继续报如下错误)

commons-collections-3.2.1

commons-logging-1.1.1

ezmorph-1.0.6

Json Lib 下载:json-lib-2.4

import net.sf.json.JSONObject;

public class TestJson {
public static void main(String[] args){
Map<String, String> map = new HashMap<String, String>();
map.put("key", "value");
map.put("name", "abc");
JSONObject json = JSONObject.fromObject(map);
System.out.println(json);
}

}

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException

......

Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: