JBCefApp.isSupported() causes null pointer exception. Code compiles and builds.


JBCefApp is not recognizes at runtime and throws NPE

My code compiles and builds but at runtime JBCefApp.isSupported() throws NPE. I already emailed screenshots from all my project settings. I have the Project SDK set to the IDE SDK and jdk is also set to the intellij default sdk. The previous conversation on this issue is explained here: https://intellij-support.jetbrains.com/hc/en-us/requests/2867333 


Mazbijari, for creating plugins, it's now recommended to use Gradle setup - please upgrade your configuration so it'll be easier to keep the dependencies and compatibility under control. Probably you're running a plugin built with SDK 2020.2 in some previous version of the IDE.



Thanks Jakub

I am working with existing code and moving to Gradle is not a good option.  This may provides a hint regarding my problem though: If I set the project settings I set the Project SDK to IntelliJ IDEA IU-202.7319.50 java version 11.0.. then all Swing and awt components even the  "String"  in the editor are in red and editor suggest to use Kotlin or Android libraries. Despite this the code builds and compiles. But at runtime I get the JBCefApp error. On the other hand if I use any SDK other than the IDEA default then Swing and awt components are recognized but JCEF is not.  I think in runtime the reverse is happening: the SDK used at runtime is not the default IDEA SDK so it cannot fine JBCefApp. What do you think? 


Have you checked then the Using DevKit section of our docs? In the Setting Up a Development Environment article, it's said you should use Java 1.8.

Regarding the runtime issue - if you build your plugin with IU-202.7319.50, there is a high probability that it'll not work on previous IDEs. You have to build it with the lowest supported SDK version.


Please sign in to leave a comment.