5

I get an exception in a gwt project where I'm using the systemNanoTime()

... threw an unexpected exception: java.lang.NoSuchMethodError: com.google.common.base.Platform.systemNanoTime()J
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
    ........

I'm using guava-18. jar in Java Build Path.

jh314
  • 27,144
  • 16
  • 62
  • 82
Abdessamad Doughri
  • 1,324
  • 2
  • 16
  • 29
  • According to the javadoc of Guava, there isn't even a class named `Platform`... – fge Apr 01 '15 at 16:23
  • If your are talking about the **guava-gwt-18.0.jar** you're right but I'm using **guava-18.0.jar** where the Platform class exist, – Abdessamad Doughri Apr 01 '15 at 16:31
  • Well, [the javadoc disagrees](http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/index.html). Or this means there is a specific version of Guava for the app engine or something like that. – fge Apr 01 '15 at 16:40
  • 1
    @fge: `Platform` is a package-private class some Guava packages have. Guava's Javadoc doesn't include package-private stuff since users can't use it. And guava-gwt does have the `Platform` classes as well, since they basically exist to allow different versions of methods between GWT and normal Java. – ColinD Apr 01 '15 at 16:57

1 Answers1

14

The problem was that I'm using the google-collect-1.0-rc1.jar and guava-18.0.jar in Java Build Path for the same project so I had to removed the google-collect

Abdessamad Doughri
  • 1,324
  • 2
  • 16
  • 29