Java client library

This page provides reference documentation and related resources for the Translation Java client library.

Resource Description
Library reference Translation Java library reference
Language guide General guide for using Java with GCP
GitHub repository Source code and additional documentation for this library
Quickstart Introduction to using this library
Stack Overflow Questions tagged with Translation and Java

Installation

To install the client library:

If you are using Maven, add the following to your pom.xml file:
<dependencyManagement>
 <dependencies>
  <dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>libraries-bom</artifactId>
    <version>2.8.0</version>
    <type>pom</type>
    <scope>import</scope>
   </dependency>
 </dependencies>
</dependencyManagement>

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-translate</artifactId>
</dependency>
If you are using Gradle, add the following to your dependencies:
compile 'com.google.cloud:google-cloud-translate:1.94.1'
If you are using SBT, add the following to your dependencies:
libraryDependencies += "com.google.cloud" % "google-cloud-translate" % "1.94.1"

If you're using IntelliJ or Eclipse, you can add client libraries to your project using the following IDE plugins:

The plugins provide additional functionality, such as key management for service accounts. Refer to each plugin's documentation for details.

Using the client library

To use the Java client library for Cloud Translation - Advanced, you must use the com.google.cloud.translate.v3 package. See how to translate text for additional details.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Translation
Need help? Visit our support page.