简体   繁体   中英

Add lombok plugin to IntelliJ 12.1.4. on Mac

I'm just trying to add the Lombok plugin to IntelliJ IDEA 12.1.4. on a Mac machine, see:

The documentation on this page ( https://code.google.com/p/lombok-intellij-plugin/ ) said:

...just download, unzip to IntelliJ plugin directory and try out!


First I had to use EasyFind to find out this folder, because it was invisible...

than I put the plugin at the directory:

~/Library/Application Support/IntelliJIdeaXX

as specified on this page ( http://devnet.jetbrains.com/docs/DOC-181 ), and redeployed the app. But the code keeps showing compile errors on every line that uses Lombok's features, even the simple @Getter and @Setter annotations.

so I've restarted the IDE, the highlighted compile time errors were gone, but when I run it on Glassfish it caught the compile time error, on the same line of code: trying to get a property using getter method that is generated by Lombok.


Exception:

Caused by: java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at com.codepianist.model.Model.<clinit>(Model.java:40)
... 50 more


Error:

// Error code
@Getter
private static Map<String, Language> LANGUAGES_MAP = new HashMap();
static {
    for(Language l : LANGUAGES)
        LANGUAGES_MAP.put(l.getId(), l); // line 40
}


Language Class:

// Language class
public class Language implements Serializable{

    public Language(){}

    public Language(String id, String flag) {
        this.id = id;
        this.flag = flag;
        this.locale =  new Locale(id);
    }

    @Getter private String id;
    @Getter private String flag;
    @Getter private Locale locale;

}


For information : Tried to call mvn clean install -e from my Terminal and not a single error. And the same app, runs fine with Netbeans.

May I have to configure the plugin on any IDE section?

I'm migrating from Netbeans, and just installed IntelliJ IDE, so I'm pretty new to it.

Thanks in advance.

尝试使用以下指南安装插件: http : //www.jetbrains.com/idea/features/open_api_plugin_manager.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM