[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Google OAuth Client Library for Java can be downloaded as a zip file or accessed using Maven.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the Google Play Services library for optimal performance in Android applications when applicable.\u003c/p\u003e\n"],["\u003cp\u003eSpecific jar files are needed for compatibility with Android, Google App Engine, Servlet applications, and Generic Java applications.\u003c/p\u003e\n"],["\u003cp\u003eThe library is divided into five modules: google-oauth-client, google-oauth-client-servlet, google-oauth-client-appengine, google-oauth-client-java6, and google-oauth-client-jetty, each with their Maven dependencies.\u003c/p\u003e\n"],["\u003cp\u003eThe google-oauth-client module is compatible with all supported Java platforms, including Android, but Android users need to exclude unused dependencies to prevent conflicts.\u003c/p\u003e\n"]]],[],null,["# Setup Instructions\n\nYou can download the Google OAuth Client Library for Java and its dependencies in\na zip file, or you can use Maven.\n\nAlso see the\n[ProGuard setup instructions](/api-client-library/java/google-http-java-client/setup#proguard)\nthat are part of the Google HTTP Client Library for Java documentation.\n\nDownload the library with dependencies\n--------------------------------------\n\nDownload the latest zip file, which you can find on the\n[downloads page](/api-client-library/java/google-oauth-java-client/download),\nand extract it on your computer. This zip file contains the client library class\njar files and the associated source jar files for each artifact and their\ndependencies. You can find dependency graphs and licenses for the different\nlibraries in the dependencies folder. For more details about the contents of the\ndownload, see the readme.html file.\n\n### Android\n\nIf you are developing for Android, and the Google API you want to use is\nincluded in the\n[Google Play Services library](https://developer.android.com/google/play-services/index.html),\nuse the Google Play Services library for the best performance and experience.\n\nIf you are using the Google OAuth Client Library for Java with Android, it is\nimportant to know which dependencies are compatible with Android, specifically\nwhich Android SDK level. Android applications require the following jar files, or\nnewer compatible versions, from the libs folder:\n\n- google-oauth-client-1.30.4.jar\n- google-http-client-1.32.1.jar\n- google-http-client-android-1.32.1jar\n- gson-2.8.5.jar\n- jackson-core-2.9.5.jar\n- jsr305-3.0.2.jar\n- protobuf-java-3.6.1.jar\n\n| **Warning:** For Android, you MUST place the jar files in a directory named \"libs\" so that the APK packager can find them. Otherwise, you will get a `NoClassDefFoundError` error at runtime.\n\n### Google App Engine\n\nGoogle App Engine applications require the following jar files, or newer\ncompatible versions, from the libs folder:\n\n- google-oauth-client-1.30.4.jar\n- google-oauth-client-appengine-1.30.4.jar\n- google-oauth-client-servlet-1.30.4.jar\n- google-http-client-1.32.1.jar\n- google-http-client-appengine-1.32.1.jar\n- gson-2.8.5.jar\n- jackson-core-2.9.5.jar\n- jsr305-3.0.2.jar\n- protobuf-java-3.6.1.jar\n- transaction-api-1.1.jar\n- xpp3-1.1.4c.jar\n\n### Servlet\n\nServlet applications require the following jar files, or newer compatible\nversions, from the libs folder:\n\n- google-oauth-client-1.30.4.jar\n- google-oauth-client-servlet-1.32.1.jar\n- google-http-client-1.32.1.jar\n- commons-logging-1.2.0.jar\n- gson-2.8.5.jar\n- jackson-core-2.9.5.jar\n- httpclient-4.5.9.jar\n- httpcore-4.4.11.jar\n- jackson-core-2.1.3.jar\n- jdo2-api-2.3-eb.jar\n- jsr305-3.0.2.jar\n- protobuf-java-3.6.1.jar\n- transaction-api-1.1.jar\n- xpp3-1.1.4c.jar\n\n### Generic Java\n\nGeneral purpose Java applications require the following jar files, or newer\ncompatible versions, from the libs folder:\n\n- google-oauth-client-1.30.4.jar\n- google-http-client-1.32.1.jar\n- commons-logging-1.2.0.jar\n- gson-2.8.5.jar\n- jackson-core-2.9.5.jar\n- httpclient-4.5.9.jar\n- httpcore-4.4.11.jar\n- jsr305-3.0.2.jar\n- protobuf-java-3.6.1.jar\n- xpp3-1.1.4c.jar\n\nMaven\n-----\n\nThe Google OAuth Client Library for Java is in the central\n[Maven](http://maven.apache.org) repository. The Maven `groupId` for all artifacts\nfor this library is `com.google.oauth-client`. Specific Maven instructions are given\nfor each module (below).\n\nModules\n-------\n\nThis library is composed of five modules:\n\n- [google-oauth-client](#google-oauth-client)\n- [google-oauth-client-servlet](#google-oauth-client-servlet)\n- [google-oauth-client-appengine](#google-oauth-client-appengine)\n- [google-oauth-client-java6](#google-oauth-client-java6)\n- [google-oauth-client-jetty](#google-oauth-client-jetty)\n\n### google-oauth-client\n\nGoogle OAuth Client Library for Java (google-oauth-client) is designed to be\ncompatible with all supported Java platforms, including Android.\n\nMaven usage: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOn Android, you will need to explicitly exclude unused dependencies: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n \u003cexclusions\u003e\n \u003cexclusion\u003e\n \u003cartifactId\u003expp3\u003c/artifactId\u003e\n \u003cgroupId\u003expp3\u003c/groupId\u003e\n \u003c/exclusion\u003e\n \u003cexclusion\u003e\n \u003cartifactId\u003ehttpclient\u003c/artifactId\u003e\n \u003cgroupId\u003eorg.apache.httpcomponents\u003c/groupId\u003e\n \u003c/exclusion\u003e\n \u003cexclusion\u003e\n \u003cartifactId\u003ejunit\u003c/artifactId\u003e\n \u003cgroupId\u003ejunit\u003c/groupId\u003e\n \u003c/exclusion\u003e\n \u003cexclusion\u003e\n \u003cartifactId\u003eandroid\u003c/artifactId\u003e\n \u003cgroupId\u003ecom.google.android\u003c/groupId\u003e\n \u003c/exclusion\u003e\n \u003c/exclusions\u003e\n\u003c/dependency\u003e\n```\n\n### google-oauth-client-servlet\n\nServlet and JDO extensions to the Google OAuth Client Library for Java\n(google-oauth-client-servlet) support Java servlet web applications. This module\ndepends on google-oauth-client.\n\nMaven usage: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client-servlet\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### google-oauth-client-appengine\n\nGoogle App Engine extensions to the Google OAuth Client Library for Java\n(google-oauth-client-appengine) support Java Google App Engine applications. This\nmodule depends on google-oauth-client and google-oauth-client-servlet.\n\nMaven usage: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client-appengine\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### google-oauth-client-java6\n\nJava 6 (and higher) extensions to the Google OAuth Client Library for Java\n(google-oauth-client-java6) support Java6+ applications. This module depends on\ngoogle-oauth-client.\n\nMaven usage: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client-java6\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### google-oauth-client-jetty\n\nJetty extensions to the Google OAuth Client Library for Java\n(google-oauth-client-jetty) support authorization code flow for installed\napplications. This module depends on google-oauth-client-java6.\n\nMaven usage: \n\n```java\n\u003cdependency\u003e\n \u003cgroupId\u003ecom.google.oauth-client\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-oauth-client-jetty\u003c/artifactId\u003e\n \u003cversion\u003e1.30.4\u003c/version\u003e\n\u003c/dependency\u003e\n```"]]