json格式在字符串在java中如何转换
public class Json {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = "{'name':'test','age':23}";
JSONObject json = JSONObject.fromObject(s);
String ss = json.getString("name");
System.out.println(ss);
}
}
这个报错如下:
Exception in thread "main"
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at net.sf.json.AbstractJSON.<clinit>(AbstractJSON.java:42)
at day15.Json.main(Json.java:13)
应该怎么访问呢?
------解决方案--------------------是不是少jar了 logging
lang.
NoClassDefFoundError: org/apache/commons/logging/LogFactory