Cannot resolve symbol with official example code

Answered

Hi all,

I'm following this doc to run code 'comparing_references_inspection', but some exception occur.

When I run ComparingReferencesInspectionTest, console show me "cannot resolve symbol 'Java' ". Just like *.java file on testData has not meet a proper jdk environment.

Then I found this post, but not found any specific solution there.

After deep work, I notice that mockJDK is not set on local IC dir, which means gradle download IC dir not include 'java/mockJDK-*' dir, but on github repo, it is.

 

So, could anyone help me how to solve the official problem?

0
6 comments

The test class javadoc has a note about the requirement "Requires idea.home.path to be set in build.gradle"

https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/comparing_references_inspection/build.gradle#L20

0

yes, I notice that. And download IC source code manually and set idea.home.path to that.
But it is not auto set by "gradle-intellij-plugin".

Why I use "gradle-intellij-plugin" plugin, it downloaded zip not including "mockJDK"?

0

mockJDK is not part of the IC distribution, but only available in the sources itself for now (https://youtrack.jetbrains.com/issue/IJSDK-321)

0

Emm.... sadly.
Is there any official MockJDK zip resource I can download?
I dont want my plugin tests part include manually configrations when I distribute source code to others :)

0

No, there is no such artifact. You can also externalize the property to gradle.properties or some environment variable so there won't be need to modify build.gradle directly.

0

OK, I know. Thanks a lot.

0

Please sign in to leave a comment.