What is the API for creating jar application configuration type?

Hello,

I’d like to launch a Jar configuration from my plugin. However, the class JarApplicationConfigurationType is not public. Currently, I circumvent this issue with reflections, getting the “Illegal reflective access” warnings. What is the right way for creating such configuration ?

Thanks,
Gidi

com.intellij.execution.jar.JarApplicationConfigurationType is public API of Java plugin as far as I can see. You need dependency on com.intellij.java to see it at runtime.

Thanks Yuriy for your reply.
I am working on IntelliJ idea 2021.1, because I want my plugin to support this version.
Based on the information from documentaion, I tried adding this section to build.gradle:
dependencies {
intellijPlatform {
bundledPlugin(“com.intellij.java”)
}
}

I got this error: > Could not find method intellijPlatform() for arguments [build_9dv49scydtu0rpm5kayfuakte$_run_closure5$_closure6@4b7314fc] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Reading the message in community space, I understand I am not supposed to use an older version of IntelliJ Idea to develop my plugin. I will be grateful for a link in documentation on how to provide backward compatibility to version 2021.1.

Update: I tried to add the following to build.gradle based on this link:
dependencies {
apply plugin: ‘java’
}

I still get error when I try to import com.intellij.execution.jar.JarApplicationConfiguration.
error: package com.intellij.execution.jar does not exist
import com.intellij.execution.jar.JarApplicationConfiguration;

Thanks,
Gidi

Unfortunately, new build setup of Gradle plugin v2 requires 2024.1 version of IDEs.

You need Gradle IntelliJ Plugin (1.x) block of documentation for 2021.1. Please note that we do not support that version, do not issue security updates anymore and do not fix bugs, so most likely we even will not reproduce problems you report there.