Install Gson from Github

I'm just starting to learn Java, and I need Gson for the new project I'm working on.

I feel like I'm missing something with all the installation instructions I found on the Internet - they all refer to the three jar files that I have to extract from the zip file. But when I look at Gson on github, I can not find .jar files!

https://github.com/google/gson

As soon as I find jar files, I just have to include them in the build path for the project I'm working on correctly?

I am working on this project using Eclipse.

Can someone help me with a very simple step-by-step explanation of how to start including these libraries for a complete noob for programming like me?

Also, when I include .jar files in the build path for the project, can I just call the functions?

+5
source share
3 answers

Simple put all jar files in the project folder Right Click on your Project->Properties-> Java Build Path->Libraries , and you can download Gson here. If you are looking for a specific version, add to your question

http://www.java2s.com/Code/Jar/g/Downloadgson222jar.htm

+10
source
+4
source

since you are using Gson for serialization and deSerialization of json data you have to enable the Gosn lib from here . at the end with android studio you can enable

  compile 'com.google.code.gson:gson:2.3.1' 

to your gradle. after you enable include, you can call the Gson in-builds method and constructor as: 1- Gson gson = new Gson();

2- gson.fromJson() 3- gson.toJson()

enjoy your code :) -

0
source

All Articles