1# OpenCensus Java OC-Agent Trace Exporter 2 3The *OpenCensus Java OC-Agent Trace Exporter* is the Java implementation of the OpenCensus Agent 4(OC-Agent) Trace Exporter. 5 6## Quickstart 7 8### Add the dependencies to your project 9 10For Maven add to your `pom.xml`: 11```xml 12<dependencies> 13 <dependency> 14 <groupId>io.opencensus</groupId> 15 <artifactId>opencensus-api</artifactId> 16 <version>0.17.0</version> 17 </dependency> 18 <dependency> 19 <groupId>io.opencensus</groupId> 20 <artifactId>opencensus-exporter-trace-ocagent</artifactId> 21 <version>0.17.0</version> 22 </dependency> 23 <dependency> 24 <groupId>io.opencensus</groupId> 25 <artifactId>opencensus-impl</artifactId> 26 <version>0.17.0</version> 27 <scope>runtime</scope> 28 </dependency> 29</dependencies> 30``` 31 32For Gradle add to your dependencies: 33```gradle 34compile 'io.opencensus:opencensus-api:0.17.0' 35compile 'io.opencensus:opencensus-exporter-trace-ocagent:0.17.0' 36runtime 'io.opencensus:opencensus-impl:0.17.0' 37``` 38 39### Register the exporter 40 41```java 42public class MyMainClass { 43 public static void main(String[] args) throws Exception { 44 OcAgentTraceExporter.createAndRegister(); 45 // ... 46 } 47} 48``` 49