1

I'm developing a GWT project at the moment and it's been up and running for a while. New functionality that is to be added require extensive testing, visualizing and simulating of a specific algorithm. I would like to export that specific algorithm so that I may call it directly from JavaScript and do some canvas magic.

How can I export a number of classes for direct use in JavaScript from a GWT project?

I've tried using the GWT exporter, following the Getting Started section closely. I've noticed that my output directory contains a new generator class (TestClassExporterImpl.java) but the final JavaScript output contains no trace of my TestClass or the exported methods. I'm sure I've made a mistake somewhere on the way or didn't understand the GWT exporter correctly.

Lichtblitz
  • 213
  • 2
  • 10
  • 1
    Did you try calling your JS objects in the JavaScript console? So from their example, you'll type: new com.example.Person('manolo') – udeleng Feb 25 '15 at 07:02
  • Hm, it seems the exported functionality is only provided at runtime. Calling the functions from the console works like a charm even though there's no trace of it in the JavaScript files themselves. If you provide it as an answer, I'll happily accept it. – Lichtblitz Feb 25 '15 at 09:58
  • I have the same problem. Did you find the solution? – PaintedRed Jun 23 '15 at 16:13

1 Answers1

0

Try to disable obfuscation, it will create the same names in Javascript as in the original Java code

ochakov
  • 348
  • 4
  • 7