简体   繁体   中英

IntelliJ unable to recognize groovy String

I am using IDEA - 11.1.1 and gradle - gradle-1.0-milestone-9 (I tried with release candidate 3 also) on windows-7 (if this matters) After importing gradle porject, IDEA complains about String object. I think I am missing something about grrovy configuration. I have also marked - main and test folder as Sources and Test Resources respectively. Did I miss something obvious?

在此输入图像描述

Most likely the JDK isn't set correctly in IDEA. Go to File -> Project Structure -> Project and check/fix Project SDK .

Try checking your project and module sdk.

On your module select F4 or Right click "Open Module Settings" Check your SDK and Moduel SDK

I am sure that will resolve your problem.

Check your IDEA project settings and look if your JDK is configured properly.

I suggest you use the gradle idea plugin to create your IDEA project files, instead of using the import function of existing gradle projects into IDEA, since from my experience it gave me troubles. Also adding new jars via gradle and updating your IDEA project files via gradle seems more consistent.

I uploaded a build.gradle gist, which might give you a good start: https://gist.github.com/1580234

It contains some explanatory comments.

Greets,

Jan

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