gradle-intellij-plugin | runIde gradle task - IDE immediately exists on startup

Planned

Hi,

When I run the runIde task for the gradle-intellij-plugin plugin, the IDE immediately exits with the following error:

11:37:42: Executing task 'runIde'...

> Task :compileJava
> Task :compileGroovy NO-SOURCE
> Task :patchPluginXml
> Task :processResources
> Task :classes
> Task :instrumentCode
> Task :postInstrumentCode
> Task :jar
> Task :prepareSandbox

> Task :runIde
Download https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-jbr/jbr-11_0_9-osx-x64-b944.49.tar.gz
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to method sun.java2d.SunGraphicsEnvironment.isUIScaleEnabled()
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-02-18 11:45:15,719 [ 8949] WARN - i.mac.MacOSApplicationProvider - No URL bundle (CFBundleURLTypes) is defined in the main bundle.
To be able to open external links, specify protocols in the app layout section of the build file.
Example: args.urlSchemes = ["your-protocol"] will handle following links: your-protocol://open?file=file&line=line
2021-02-18 11:45:15,731 [ 8961] ERROR - llij.ide.plugins.PluginManager - null
java.lang.NullPointerException
at java.desktop/java.awt.Window.init(Window.java:509)
at java.desktop/java.awt.Window.<init>(Window.java:448)
at java.desktop/java.awt.Window.<init>(Window.java:573)
at com.intellij.ui.Splash.<init>(Splash.java:39)
at com.intellij.idea.SplashManager.show(SplashManager.java:61)
at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$7(StartupUtil.java:362)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:419)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2021-02-18 11:45:15,732 [ 8962] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2020.2.4 Build #IC-202.8194.7
2021-02-18 11:45:15,732 [ 8962] ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.9; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2021-02-18 11:45:15,732 [ 8962] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X

Start Failed: Internal error. Please refer to http://jb.gg/ide/critical-startup-errors

java.lang.NullPointerException
at java.desktop/java.awt.Window.init(Window.java:509)
at java.desktop/java.awt.Window.<init>(Window.java:448)
at java.desktop/java.awt.Window.<init>(Window.java:573)
at com.intellij.ui.Splash.<init>(Splash.java:39)
at com.intellij.idea.SplashManager.show(SplashManager.java:61)
at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$7(StartupUtil.java:362)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:419)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

-----
JRE 11.0.9+11-b944.49 x86_64 by JetBrains s.r.o.
/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbr-11_0_9-osx-x64-b944.49/jbr/Contents/Home

Also, a UI exception occurred on an attempt to show the above message:
java.lang.NullPointerException
at java.desktop/sun.awt.SunToolkit.getScreenSize(SunToolkit.java:588)
at com.intellij.idea.Main.showMessage(Main.java:246)
at com.intellij.idea.Main.showMessage(Main.java:213)
at com.intellij.ide.plugins.StartupAbortedException.logAndExit(StartupAbortedException.java:83)
at com.intellij.ide.plugins.StartupAbortedException.processException(StartupAbortedException.java:33)
at com.intellij.ide.IdeEventQueue.processException(IdeEventQueue.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:422)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

> Task :runIde FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.2/userguide/command_line_interface.html#sec:command_line_warnings
8 actionable tasks: 8 executed

The plugin is being developed and the gradle task is being executed in Intellij Ultimate - details of build: 

IntelliJ IDEA 2020.2.3 (Ultimate Edition)
Build #IU-202.7660.26, built on October 6, 2020

Runtime version: 11.0.8+10-b944.34 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12

Plugin configuration in build.gradle:

intellij {
pluginName = "intellij-poc-plugin"
version = System.getenv().getOrDefault("IJ_VERSION", "202.7660.26")
downloadSources = true
updateSinceUntilBuild = true
plugins = []
}

I've attempted the following but the error persists:

- Complete uninstall/reinstall of all Intellij installations.

- Followed all the steps documented at http://jb.gg/ide/critical-startup-errors

- Cleared all Intellij caches and installation files as documented here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519

- Installed 'Choose Runtime' plugin and tried with different versions of the intellij-jbr.

The issue persists and I'm not sure what else should be attempted.

Can you help me understand what might prevent the Intellij Community installation (as downloaded via the gradle-intellij-plugin plugin for testing plugins) from starting up, or could you suggest a potential workaround?

Thanks,

David

0
5 comments

To add, this is the command that is being executed which results in the failure:

/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbr-11_0_8-osx-x64-b944.34/jbr/Contents/Home/bin/java -Dapple.awt.fileDialogForDirectories=true -Dapple.laf.useScreenMenuBar=true -Didea.auto.reload.plugins=true -Didea.classpath.index.enabled=false -Didea.config.path=/Users/dbinh/workspaces/intellij-poc-plugin/build/idea-sandbox/config -Didea.is.internal=true -Didea.platform.prefix=Idea -Didea.plugins.path=/Users/dbinh/workspaces/intellij-poc-plugin/build/idea-sandbox/plugins -Didea.required.plugins.id=com.allstate.intellij.plugins.templates -Didea.smooth.progress=false -Didea.system.path=/Users/dbinh/workspaces/intellij-poc-plugin/build/idea-sandbox/system -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -ea -cp /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/lib/tools.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/idea_rt.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/idea.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/bootstrap.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/extensions.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/util.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/openapi.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/trove4j.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/jdom.jar:/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/lib/log4j.jar com.intellij.idea.Main

If I go directly into the gradle cache and run the idea.sh, it opens correctly:

/Users/dbinh/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/202.7660.26/8da1f9add5eaff238a403058a25a22be5a339336/ideaIC-202.7660.26/bin/idea.sh

 

0

To add a little more information to this as I try to resolve - this appears related to the JBR installation used to launch the IDE. While using a different configuration the runIde task fell back to 'local Java' rather than the JBR, and the IDE launched without error.

This isn't ideal as features such as JCEF don't seem to work without the JBE installation.

After updating to Intellij Community 2020.3 and with the following configuration, the original issue from the first post still occurs:

intellij {
pluginName = "intellij-poc-plugin"
version = System.getenv().getOrDefault("IJ_VERSION", "203.7148.57")
downloadSources = true
updateSinceUntilBuild = true
plugins = ["java"]
}

runIde {
jbrVersion = "jbr-11_0_9b1145.21"
}

When it falls back to a local Java installation (and not a JBR), the IDE starts.

Could you help me understand why the JBR might be failing for me, no matter what combination of IDE and JBR / Java version I use?

0

David, sorry for the late reply!

Which version of the Gradle IntelliJ Plugin do you use?

0.7.x has fixed the issue with an incorrect JBR used to spin up the project (however, please wait for the 0.7.2 release).

As soon as it'll be available, I'd ask you to review your issue again.

0

Thanks Jakub this is good news to hear! I'm currently on 0.6.5 as I couldn't find a release of 0.7.0.

Do you have any idea when 0.7.2 will be available?

Thanks,

David

0

Please sign in to leave a comment.