Eclipse getBundle().getDataFile() equivalent in Intellij

Hi Intellij team,

In Eclipse we have below methods. Do we have any equivalent methods in Intellij?

I've Created an Intellij-plugin jar, which has many dependent jars inside it, which i would like to copy into getDataFile() and load dynamically  through class loader.


org.eclipse.core.runtime.Plugin.getBundle()  - Returns the bundle associated with this plug-in.
org.osgi.framework.Bundle.getDataFile(String filename)  - Creates a File object for a file in the persistent storage area provided for this bundle by the Framework. This method will return null if the platform does not have file system support or this bundle is a fragment bundle
1 comment
Comment actions Permalink

Something along these lines will get you the path to files of your plugin:

PluginId pluginId = PluginManagerCore.getPluginByClassName(getClass().getName());

IdeaPluginDescriptor descriptor = PluginManager.getPlugin(pluginId);

File jarPath = new File(descriptor.getPath(), "lib/extraJars/additional.jar");


Please sign in to leave a comment.