software development for the
existentially challenged
Older | Newer Older | Newer
GWT Random function and java.lang.unsatisfiedlinkerror
comment share
Trying to use com.google.gwt.user.client.Random.getInt() in a main method like so
public static void main(String[] args) {Random.nextInt();}
I get this crazy error
Exception in thread "main" java.lang.UnsatisfiedLinkError: nextInt
at com.google.gwt.user.client.Random.nextInt(Native Method)
Why is this happening? The static methods on Random are JSNI methods, which require a running GWT environment to link to Javascript methods.

The same error happened in a test case inheriting from junit.framework.TestCase. When I switched to GWTTestCase or made the nextInt() call in my application, it worked perfectly

This post helped me figure out the problem: java.lang.UnsatisfiedLinkError when using GWT client API

0 comments:

Post a Comment

What is this site?!

t (a professional software developer for a big company) writes about software development and stuff. Unix, Java, Groovy, OS X, and lots of open source libraries and tools.