Download Gson-2.2.2.jar Apr 2026

Here's a simple example of using Gson 2.2.2 to convert a Java object to JSON: public class User { private String name; private int age;

<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.2.2</version> </dependency> Then, run mvn clean install to download the dependency. If you're using Gradle, add the following to your build.gradle file: download gson-2.2.2.jar

public User(String name, int age) { this.name = name; this.age = age; } Here's a simple example of using Gson 2

public String getName() { return name; } private int age

public int getAge() { return age; } } import com.google.gson.Gson;