解决方法:

1、右键项目 ---> properties ----> java buildpath ---> order and export

2、 勾选 gson-x.x.x.jar

3、保存设置,clean 项目并重新编译执行即可。

Gson转换Json串为对象报java.lang.NoClassDefFoundError的更多相关文章

  1. Eclipse下执行main函数报java.lang.NoClassDefFoundError的解决

    今天执行eclipse下的一个java类,无论run还是debug,都报java.lang.NoClassDefFoundError.而且把main中函数都注释掉,执行还是报一样的错. 检查了一下这个 ...

  2. json转xml报[java.lang.NoClassDefFoundError: nu/xom/Serializer]

    原文:http://blog.csdn.net/figo645/article/details/48413571 开始学习JSON了,那么很自然的,我开始要熟悉一些基本的JSON语法 {}代表对象,[ ...

  3. struts2 action中字符串转json对象出错 java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException

    commons-lang包有错,要么是引入错误,要么是没引入. 报不同错误,引入不同包. commons-beanutils-1.8.0.jar不加这个包 java.lang.NoClassDefFo ...

  4. 用dom4j解析xml 报java.lang.NoClassDefFoundError:org/jaxen/JaxenException

    转自:http://www.myexception.cn/java%20exception/95.html 源码如下: import java.io.File; import java.util.Li ...

  5. 我的Android进阶之旅------>Android项目运行报java.lang.NoClassDefFoundError错误的解决办法

    今天在运行一个Android项目的时候,报了以下错误: D/AndroidRuntime( 3859): Shutting down VM E/AndroidRuntime( 3859): FATAL ...

  6. Spring配置c3p0数据源时出错报:java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector

    今天在使用Spring配置c3p0数据源时,使用的数据库是mysql,服务器是tomcat,运行时报了一个 java.lang.NoClassDefFoundError: com/mchange/v2 ...

  7. myeclipse6.5使用tomcat7报java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory错

    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFact ...

  8. spring boot 启动报 java.lang.NoClassDefFoundError: ch/qos/logback/core/spi/LifeCycle 错误

    Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: ch/qos ...

  9. Gson转换json数据为对象

    可以通过Gson使用两种方法,将json字符串转换为对象,以下面该段报文做测试 { "id": 84041462, "lastName": "小华&q ...

随机推荐

  1. Beego:原生方式使用MySQL

    示例: package controllers import ( "database/sql" "fmt" "github.com/astaxie/b ...

  2. 页面布局排版-block,inline,float,relative,absolute等

    1.span和div的区别 div是块元素(block),span是行内元素(inline): span什么事也不会做,它存在的目的在与为开发者给它所围绕的元素指定样式.div类似,不过它引入了行分隔 ...

  3. pandas.read_csv 报ssl.SSLError

  4. 安装完Centos 7后的一些处理

    1.安装dkms:dkms-2.2.0.3-31.1.noarch.rpm 2.安装显卡驱动:amdgpu-pro-18.10-572953 3.启动图形界面使用init 5 不能使用startx

  5. LeetCode(67) Add Binary

    题目 Given two binary strings, return their sum (also a binary string). For example, a = "11" ...

  6. Farthest Nodes in a Tree (求树的直径)

    题目链接,密码:hpu Description Given a tree (a connected graph with no cycles), you have to find the farthe ...

  7. 【URAL 1989】 Subpalindromes(线段树维护哈希)

    Description You have a string and queries of two types: replace i'th character of the string by char ...

  8. django1.11 启动错误:Generator expression must be parenthesized

    错误信息: Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0 ...

  9. spring用到的设计模式

    https://www.cnblogs.com/yuefan/p/3763898.html https://www.cnblogs.com/hwaggLee/p/4510687.html https: ...

  10. xtu DP Training C.炮兵阵地

    炮兵阵地 Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on PKU. Original ID: 11856 ...