title: TeaVM and WebAssembly - build errors
body: <p>I want to use Java code in the web. For this I want to convert Java to WASM and use this wasm-file in JavaScript. For converting Java to WebAssembly, I am using TeaVM.</p>
  <p>First, I created an archetype with this command: <code>mvn archetype:generate  -DarchetypeGroupId=org.teavm.flavour -DarchetypeArtifactId=teavm-flavour-application -DarchetypeVersion=0.2.0</code></p>
  <p>In addition, I added these two dependencies (according to <a href="http://blog.dmitryalexandrov.net/webassembly-for-java-developers/" rel="nofollow noreferrer">http://blog.dmitryalexandrov.net/webassembly-for-java-developers/</a>):</p>
  <pre><code>   &lt;dependency&gt;
          &lt;groupId&gt;org.teavm&lt;/groupId&gt;
          &lt;artifactId&gt;teavm-jso-apis&lt;/artifactId&gt;
          &lt;version&gt;${teavm.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.teavm&lt;/groupId&gt;
          &lt;artifactId&gt;teavm-interop&lt;/artifactId&gt;
          &lt;version&gt;${teavm.version}&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>and added the following in the plugin section:</p>
  <pre><code>&lt;targetType&gt;WEBASSEMBLY&lt;/targetType&gt;
  &lt;optimizationLevel&gt;FULL&lt;/optimizationLevel&gt;
  &lt;heapSize&gt;8&lt;/heapSize&gt;
  </code></pre>
  <p>My Java file:</p>
  <pre><code>@BindTemplate(&quot;templates/client.html&quot;)
  public class Client extends ApplicationTemplate {
      private String userName = &quot;ABC&quot;;
  
      public static void main(String[] args) {
          Client client = new Client();
          client.bind(&quot;application-content&quot;);
      }
      @Export(name = &quot;getUserName&quot;)
      public String getUserName() {
          return userName;
      }
  }
  </code></pre>
  <p>But when I am doing mvn clean package, I am getting to following error (but a wasm file is created):</p>
  <p><a href="https://i.stack.imgur.com/GZ8xb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GZ8xb.png" alt="error when mvn clean package" /></a></p>
  <p>my complete pom:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;my.company&lt;/groupId&gt;
    &lt;artifactId&gt;java_wasm&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;flavour.version&gt;0.2.0&lt;/flavour.version&gt;
      &lt;teavm.version&gt;0.6.0&lt;/teavm.version&gt;
      &lt;jackson.version&gt;2.5.4&lt;/jackson.version&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.teavm&lt;/groupId&gt;
        &lt;artifactId&gt;teavm-classlib&lt;/artifactId&gt;
        &lt;version&gt;${teavm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.teavm&lt;/groupId&gt;
        &lt;artifactId&gt;teavm-metaprogramming-impl&lt;/artifactId&gt;
        &lt;version&gt;${teavm.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.teavm.flavour&lt;/groupId&gt;
        &lt;artifactId&gt;teavm-flavour-widgets&lt;/artifactId&gt;
        &lt;version&gt;${flavour.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.teavm.flavour&lt;/groupId&gt;
        &lt;artifactId&gt;teavm-flavour-rest&lt;/artifactId&gt;
        &lt;version&gt;${flavour.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.teavm&lt;/groupId&gt;
          &lt;artifactId&gt;teavm-jso-apis&lt;/artifactId&gt;
          &lt;version&gt;${teavm.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.teavm&lt;/groupId&gt;
          &lt;artifactId&gt;teavm-interop&lt;/artifactId&gt;
          &lt;version&gt;${teavm.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
        &lt;version&gt;${jackson.version}&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;${java.version}&lt;/source&gt;
            &lt;target&gt;${java.version}&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
  
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;configuration&gt;
            &lt;webResources&gt;
              &lt;resource&gt;
                &lt;directory&gt;${project.build.directory}/generated/js&lt;/directory&gt;
              &lt;/resource&gt;
            &lt;/webResources&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
  
        &lt;plugin&gt;
          &lt;groupId&gt;org.teavm&lt;/groupId&gt;
          &lt;artifactId&gt;teavm-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;${teavm.version}&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;web-client&lt;/id&gt;
              &lt;phase&gt;prepare-package&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;compile&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;targetDirectory&gt;${project.build.directory}/generated/js/teavm&lt;/targetDirectory&gt;
                &lt;mainClass&gt;my.company.Client&lt;/mainClass&gt;
                &lt;minifying&gt;true&lt;/minifying&gt;
                &lt;debugInformationGenerated&gt;true&lt;/debugInformationGenerated&gt;
                &lt;sourceMapsGenerated&gt;true&lt;/sourceMapsGenerated&gt;
                &lt;sourceFilesCopied&gt;true&lt;/sourceFilesCopied&gt;
                &lt;optimizationLevel&gt;ADVANCED&lt;/optimizationLevel&gt;
                &lt;targetType&gt;WEBASSEMBLY&lt;/targetType&gt;
                &lt;optimizationLevel&gt;FULL&lt;/optimizationLevel&gt;
                &lt;heapSize&gt;8&lt;/heapSize&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  <p>How can I create a complete WASM without errors? Thank you in advance!</p>