Sunday, December 3, 2017

Re: JsInterop: annotations not found

In the bright light of morning, I can see the problem. The javac message tells me javac is searching my srcdir for some of the jsinterop sources. They are in the jar files in my class path, but not in my srcdir. I will experiment to find the best way to handle this.

Thanks for your help.

On Saturday, December 2, 2017 at 11:00:29 PM UTC-8, Bob Woodbury wrote:
I am learning to use jsinterop, and I am stuck at square one -- javac won't recognize the @JsType annotation.

I'm using the jdk1.8.0_102 and apache-ant-1.10.1 and gwt-2.8.2 on Linux (Fedora).

My project compiles without problems until I try to add "MyClass" with the @JsType annotation.

I lifted the following code from the tutorial at:

package com.webshoz.insight.client.iaol;

import jsinterop.annotations.*;  // I have tried compiling with and without this import, without success.

public class MyClass {

public String name;

public MyClass(String name) { = name;

public void sayHello() {
return "Hello" +;

The relevant parts of my Ant build file are:

<?xml version="1.0" encoding="utf-8" ?>
<project name="Insight" default="build" basedir=".">

<path id="project.class.path">
<pathelement location="war/WEB-INF/classes"/>
<fileset dir="war/WEB-INF/lib" includes="**/*.jar"/>

<target name="javac" description="Compile java source">
<javac srcdir="src" includes="**" encoding="utf-8"
source="1.8" target="1.8" nowarn="false"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-verbose"/>
<compilerarg value="-Xlint"/>
<compilerarg value="-XprintProcessorInfo"/>

<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="">
<pathelement location="src"/>
<path refid="project.class.path"/>
<jvmarg value="-Xmx512M"/>
<arg line="-generateJsInteropExports -strict -XdisableUpdateCheck"/>
<arg value="com.webshoz.insight.Application"/>
<arg value="com.webshoz.insight.Iaol"/>


The javac compiler puts out the following:

[javac] Processor matches [java.lang.Override, jsinterop.annotations.JsType] and returns false.
[javac] warning: No processor claimed any of these annotations: jsinterop.annotations.JsType
[javac] [search path for source files: /house/Dev/Insight/branches/IAOL/src]

Can anyone tell me what I'm missing? Thanks!

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment