Reputation: 3346
I am learning to developing an Intellij Plugin with version 2018.2.5 Ultimate Edition. There is not much code to show because it is look like Hello Word Example. When I run the code I am having an errors that given at below.
public class ImportAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
}
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
PsiFile file = e.getData(LangDataKeys.PSI_FILE);
Editor editor = e.getData(PlatformDataKeys.EDITOR_EVEN_IF_INACTIVE);
if (file == null || editor == null) {
e.getPresentation().setEnabled(false);
return;
}
int offset = editor.getCaretModel().getOffset();
PsiElement element = file.findElementAt(offset);
PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
if (psiClass == null) {
e.getPresentation().setEnabled(false);
}
}
}
When i run the the project, another Intellij opens but when i select a project or create new project nothing happens.
Upvotes: 0
Views: 1709
Reputation: 97148
You need to use JDK 8, not JDK 10, as the JDK under which you run the debug instance of IntelliJ IDEA.
Upvotes: 3