1、下载
You will need to download Gson Jar ( “gson-2.6.2.jar” ) from the maven repo. Make sure to keep a note of where you saved it.
2、创建一个对于Gson的用户库(Creating a User Library for Gson)
- Open Windows >preferences in the Eclipse menu
- avigate to the Java >Build path > User Libraries tab
- Click new and enter a new User Library name: like “gson_lib” and hit ok.
- With “gson_lib” selected press Add External JARs and find the gson-2.6.2.jar you downloaded.
- Apply and Close.
3、将用户库添加到一个包中(Adding the User Library to a package.)
- Right click