Emre Aktürk
Emre Aktürk

Reputation: 3346

Illegal reflective access by com.intellij.ide.ClassUtilCore to field sun.net.www.protocol.jar.JarFileFactory.fileCache

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);
       }
   }
}

Error

Project Stucture enter image description here

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

Answers (1)

yole
yole

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

Related Questions