cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 158 forks source link

UnsatisfiedLinkError: jsweet.lang.Object.$set(Ljava/lang/String;Ljava/lang/Object;)V #121

Closed david-a-diaz closed 8 years ago

david-a-diaz commented 8 years ago

Hi,

When I try to run a simple example:

public class Main { public static void main(String[] args) { jsweet.lang.Object m_permanentListeners = new jsweet.lang.Object(); m_permanentListeners.$set("test", "value"); } }

I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: jsweet.lang.Object.$set(Ljava/lang/String;Ljava/lang/Object;)V at jsweet.lang.Object.$set(Native Method) at Main.main(Main.java:12)

I'm testing on Mac with the JDK 8 but we are seeing the error on Windows with JDK 8 as well.

Can you help us out?

renaudpawlak commented 8 years ago

Hello! You are supposed to take the JS output of JSweet and run it in a browser (or with node.js). Here you are trying to run a JSweet program with a JRE, which explains the problem. Note that some JSweet programs that only use Java API can also run in a JRE (that way you can share code between Java and JavaScript). But here you are using a JSweet API which is JavaScript-specific ($set) and cannot run in Java.