IntelliJ

Java functionality extracted as a plugin

In the latest EAP build of IntelliJ IDEA 2019.2 we’ve extracted Java functionality into a separate plugin. This separates the Java implementation from the “platform” part of IntelliJ IDEA and introduces some flexibility for the future. For example, we could include Java functionality as a plugin to other products, and other plugins such as Gradle can now take optional dependencies on Java, and still work if Java isn’t available.

The new plugin is not visible in Settings | Plugins and cannot be switched off, so there should be no impact on end users. However, if you’re writing a plugin for IntelliJ IDEA you may need to make some small changes to continue working correctly.

Firstly, if your plugin depends on the Java part of the IntelliJ API, you will need to declare this dependency in your plugin.xml file, by adding the following line:

<depends>com.intellij.modules.java</depends>

You might have this line in your plugin.xml already, as this is the recommended way of declaring a dependency on the Java functionality, even for earlier versions of IntelliJ IDEA. However, it is now required, to ensure that your plugin can access classes from the Java plugin at runtime. See the Plugin Compatibility with IntelliJ Platform Products page for more details on dependencies.

Secondly, if you’re developing a plugin using gradle-intellij-plugin (please make sure you’re using the latest version), you need to tell Gradle about the Java plugin. Add the following to build.gradle in order to include classes from the Java plugin into the compilation classpath, and tell the IDE to load the plugin at runtime:

intellij {
  plugins = ['com.intellij.java']
  // ...
}

Please let us know if you have any issues.

image description