PsiClass to java Class conversion
Answered
I am writing an intelliJ plugin where I need to get java class from PsiClass. For that I am writing this code,
Class<?> clazz = Class.forName(psiClass.getQualifiedName());
But it is not working, giving ClassNotFoundException. For my use case, I want to access the methods of java class. I tried searching it and found this relevant post where it is mentioned that it is not possible. Is there any workaround to achieve what I want.
Please sign in to leave a comment.
Hi,
It is impossible because neither your plugin's classpath nor IDE's classpath contains JARs being a part of the project opened in the IDE.
What is your exact use case? Why do you need to access these methods?