Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Java & Android

Rollbar SDK for Java and Android

Rollbar for Java and Android

Build Status

The current library has undergone a major overhaul between versions 0.5.4 and 1.0.0.
We recommend upgrading from prior versions of rollbar-java, but that process may require some
work on your end for the more complex use cases of the old library.

The code is documented with javadoc and therefore should be usable from viewing
the documentation in the source. There are examples in the examples directory showing different
use cases for consuming these libraries.

There are currently four libraries in this repository:

  • rollbar-api
  • rollbar-java
  • rollbar-web
  • rollbar-android

rollbar-api is a set of data objects representing structures that make up the payload
the backend API understands.

rollbar-java has the core functionality for taking input from your code and transmitting
it to our API. rollbar-java depends on rollbar-api and provides many points of
customizing its behavior.

rollbar-web is a higher level abstraction built on rollbar-java which intended to be
integrated into web servers based on the Servlet API.

rollbar-android is a library for use in an Android environment built on rollbar-java.

The example directory contains examples using rollbar-java directly as well as using
rollbar-web and rollbar-android.


To report problems or ask a question please create an issue.



Upgrading from 0.5.4 or earlier to 1.0.0

This package used to be divided into five modules

  • rollbar-utilities
  • rollbar-testing
  • rollbar-sender
  • rollbar-payload
  • rollbar

As of 1.0.0 we have changed the project structure to these modules

  • rollbar-api
  • rollbar-java
  • rollbar-web
  • rollbar-android

rollbar-api contains roughly the same objects as rollbar-payload previously did. The main
difference being that the objects are now constructed via builders rather than a new allocation in
every setter. Therefore, any usage of rollbar-payload objects is still possible, but the style is
slightly changed. For example, one of the examples for specifying the server information from the
old documentation

Server s = new Server()
    .put("TAttUQoLtUaE", 42);

The equivalent is now:

Server s = new Server.Builder()

The Extensible base class from rollbar-utilities is no longer used in favor of sticking more
closely to the spec.

The other use cases from those old docs was calling send directly on a Payload object:

// Throwable t
Payload p = Payload.fromError(SERVER_POST_ACCESS_TOKEN, ENVIRONMENT, t, null);

This is no longer directly supported. The equivalent is to use Rollbar directly, either by
constructing a new instance (new Rollbar(config)) or by using the library managed singleton

// Throwable t
Config config = withAccessToken(SERVER_POST_ACCESS_TOKEN)
Rollbar rollbar = Rollbar.init(config);

There is a shim that has the same basic API as the old library located in the rollbar-java
package at com.rollbar.Rollbar. This class is marked as deprecated as it is only intended to
make upgrading slightly more convenient. This old example code should still work thanks to this shim class:

import com.rollbar.Rollbar;
public class MainClass {
    public static final Rollbar rollbar = new Rollbar("ACCESS_TOKEN", "production");
    public int main(String[] args) {
        return 0;

However, we strongly advise upgrading to at least this equivalent using the new library:

 import com.rollbar.notifier.Rollbar;
 public class MainClass {
     public static final Rollbar rollbar = new Rollbar(
     public int main(String[] args) {
         return 0;


You can, of course, build it yourself and depend on the .jar manually,
however, the modules are up on maven central and can be installed in
most tool chains.


All these can be installed as Maven projects. Simply add the
dependency to your pom file:





For actual usage, the easiest way to get started is by looking at the examples:


Check out this blog post for more information on how to use rollbar-java in your Spring app.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Java & Android

Rollbar SDK for Java and Android