错误添加GSON库外部JAR时 [英] Error when adding Gson library external Jar

查看:102
本文介绍了错误添加GSON库外部JAR时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用GSON库,可用于转换Java对象到他们的JSON重新presentation但一个Java库岂不的作品。

i would like to use the GSON library, a Java library that can be used to convert Java Objects into their JSON representation but it not works.

属性 - > Java构建路径 - >库 - >添加外部JAR(添加下载GSON JAR)

Properties -> Java Build Path -> Libraries -> Add External JARs (add the downloaded gson jar)

我得到这个错误:

caused by: java.lang.NoClassDefFoundError: com.google.gson.GsonBuilder

帮助

推荐答案

尝试创建项目下的文件夹调用'库',并复制GSON罐子交给'库'目录,并重复上述脚下。

Try creating a folder call 'lib' under your project and copy the gson jar over to 'lib' directory and repeat your step above.

这篇关于错误添加GSON库外部JAR时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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