I am trying to develop a plugin for IntelliJ Idea community edition, I am creating the plugin project like shown Creating Plugin Project
I am using Java to develop the plugin and gradle as my build tool, I was able to develop and deploy the plugin successfully.I used Java Swing library to develop the UI part, now I want to use JetBrains libraries like com.intellij.ui.*, icons & etc.
When I try to use the JB libraries I am getting NoClassDefFoundError.
Exception in thread "main"
Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/ui/components/JBLabel
at Test.main(Test.java:8)
Caused by: java.lang.ClassNotFoundException: com.intellij.ui.components.JBLabel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 1 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Test.main()'.
> Process 'command '/home/dharun/.jdks/jbr-17.0.11/bin/java'' finished with non-zero exit value 1
I guess that this is caused due to there is no class or libraries found during runtime, but I am able to use the JB libraries at compile time most of the UI components are available to use and code with it. but I am getting error while running/execution. Using JB Library in compile time
I have tried configuring different JDKs for the project and checked my dependecies as well when I am able to use the JetBrains libaries in compile time but at runtime throws exception
If I use main method to execute I am able to create new JLabel() of swing library but the same does not apply for new JBLabel() of jetbrains library