我可以在开发模式中使用GWT吗? [英] Can I use Lombok with GWT in Development Mode?

查看:117
本文介绍了我可以在开发模式中使用GWT吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照官方说明的说法在开发模式下运行Lomboked GWT项目,但或者我做错了什么,或者这不适用于当前版本的GWT?



我得到的错误是:


类型为MyData的方法setA(int)未定义。

MyData很简单:

  @Data 
public class MyData {
private int a;
}

我指定


-javaagent:/path/to/lombok.jar=ECJ


在我的Eclipse Run配置(作为虚拟机参数)。



我也尝试过使用


-Xbootclasspath / p:/path/to/lombok.jar


,以及从我的ant文件启动开发模式等。

问题是,我大多只是猜测整个设置应该如何工作,所以我想问一个问题,正确的设置看起来像?

解决方案

您现在可能已经开始工作了,但我可以确认它可以与GWT2 .4 / Eclipse 3.7。所需的唯一选项是-javaagent VM arg,并将lombok.jar添加到classpath / buildpath。

我认为在第一次开始使用它时,会遇到一些问题,可以使用gwt-unitCache文件夹和war / WEB-INF / classes文件夹,清除这些设置可能是一个很好的步骤!

I tried to follow the official instructions on running a lomboked GWT project in dev mode, but either I'm doing something wrong, or this doesn't work with current versions of GWT anymore?

The error I get is:

"The method setA(int) is undefined for the type MyData".

MyData is simple:

@Data
public class MyData {
  private int a;
}

I'm specifying

-javaagent:/path/to/lombok.jar=ECJ

in my Eclipse Run Configuration (as a VM argument).

I also tried playing around with

-Xbootclasspath/p:/path/to/lombok.jar

, as well as starting dev mode from my ant file, etc.

The problem is, that I'm mostly just guessing how the whole setup should work, so instead of troubleshooting my poor attempts, I'd like to ask how a correct setup would look like?

解决方案

You've probably got it working by now, but I can confirm it does work with GWT2.4 / Eclipse 3.7 . The only option needed is the -javaagent VM arg, and adding lombok.jar to the classpath/buildpath.

I think there's some issues when you first start to use it, to do with either the gwt-unitCache folder, and the war/WEB-INF/classes folder, clearing these is probably a good step when setting it up !

这篇关于我可以在开发模式中使用GWT吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆