将Gson添加到netbeans java项目 [英] Adding Gson to netbeans java project
问题描述
我从它的源代码下载了gson.jar。
右键单击库文件夹 - >添加新的 - >添加jar - > gson.jar
然而,当我尝试使用
Gson gson = new Gson();
它抱怨它无法找到Gson符号。
如何将gson添加到项目中的正确方法是什么?我不使用maven
感谢您的帮助!
你会看到这样的:
为了使用netbeans导入Gson,您需要从这里下载3个文件:
然后,您必须创建一个库netbeans:
- 右键单击库(在您要添加Gson的项目中)
- 类别:库
- 添加库(写一个名称,例如:Gson)
- 您必须在每个选项卡中导入正确的文件:classpath,sources,javadoc
现在就可以使用了!
I have downloaded gson.jar from its source.
Right-clicked at libraries folder -> add new -> add jar -> gson.jar
However when i try to use
Gson gson = new Gson();
It complains that it cannot find symbol Gson.
What is the right way how to add gson to the project? I am not using maven
Thanks for help!
Go to Download Gson
There, access last Gson version:
You will see sth like this:
In order to import Gson using netbeans you will need to download 3 files from here:
- gson-2.8.0.jar (classpath)
- gson-2.8.0-sources.jar (sources)
- gson-2.8.0-javadoc.jar (javadoc)
Then, you have to create a library on netbeans:
- Right click on Libraries (inside the project in which you want to add Gson)
- Properties
- In categories: Libraries
- Add Library (write a name, e.g.: Gson)
- You have to import the right file in each of the tabs: classpath, sources, javadoc
It should work now!
这篇关于将Gson添加到netbeans java项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!