How to create an empty IntelliJ IDEA plugin project?

Answered

I want to create a plugin for IntelliJ IDEA. I install the Intellij IDEA 2021.3 and the Oracle OpenJDK 17.0.1.

I try to create an empty plugin project following this instruction. I select the Gradle, then check the IntelliJ Platform Plugin and chois the OpenJDK 17 in the Project SDK list. Then I press next->finish.

The new empty project is opening and after a few seconds I look at the message "my_plugin:test: Could not find org.jetbrains:annotations:22.0.0."

Also I tride to create an empty IDEA plugin project wih the IDEA 2021.3 and the Oracle OpenJDK 15. And with the IDEA 2021.1.3 and the Oracle OpenJDK 15. The result is the same.

Why does the Gradle not creating a project automatically? And how can I create an empty IntelliJ IDEA plugin project correctly?

P.S. Your recommendation (wich last updat is 08 March 2021) says: "To add the library with annotations to a Gradle project, add the compile 'org.jetbrains:annotations:16.0.2' dependency to the build.gradle file". But the answer on StackOverflow (with links to gradle.org) says that "the compile, runtime, testCompile, and testRuntime configurations introduced by the Java plugin have been deprecated since Gradle 4.10 (Aug 27, 2018), and were finally removed in Gradle 7.0 (Apr 9, 2021)"

Is this the reason of my problem? If yes, will you correct your documentation? And what shall I do to solve the problem?

0
10 comments

I have tried the Java 11. The result is the same.

0

Please check Preferences | Build, Execution, Deployment | Build Tools | Gradle setting "Gradle JVM" is also set to Java 11.

Please also check it's using Gradle as defined gradle/wrapper/gradle-wrapper.properties which should point to Gradle 7.x

0

I checked the Gradle JVM. It set to the Java 11 automatically. Also I checked the gradle-wrapper.properties. There is the Gradle-7.1. The problem is still there. Thank you for your really fast answers. But may I ask if you have test the creating an empty plugin project on the freshly installed IntelliJ IDEA 2021.3 ?

0

Please check VM options for your IDE (https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties) and remove this entry if existing

-Djsse.enableSNIExtension=false

0

The Help | Edit Custom VM Options opens the idea64.exe.vmoptions file. In my case its content is:

-Xmx2048m

The idea64.exe.vmoptions file content from the ../bin directory is:

-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=512m
-XX:+IgnoreUnrecognizedVMOptions
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off

There is no Djsse.enableSNIExtension.

0

I also replaced the power cable of my desktop and wash my screen with wet wipes. But it does'n help.

0

Please add this snippet in build.gradle before "intellij { ....}"

 

repositories {
mavenCentral()
}
0

Thank you very much!! It works!

I wonder why does the modern industry is so awkward? I have tried to use the IDEA 2020.3, and there is an error in the build.gradle file too but different kinde. It seemse than it is't very hard to create a virtual machine with pure OS and a freshly installed new IDEA before release and then try to create base projects such as empty plugins project. I think next step to the hell are non-buildable examples from the help :) I understand that it is not a unique JetBrains feature. It is the problem of all industry. But how did it get to this?

0

Please sign in to leave a comment.