Unable to use JBCEF in IDEA 2020.2

Answered

I want to use the browser component of JCEF in my Gradle-based JavaFX Kotlin project as a replacement of the JavaFX WebView. I'm running IDEA 2020.2 with the JBR SDK 11 and necessary plugins/libraries to keep my JavaFX code working.
Following [this guide](https://jetbrains.org/intellij/sdk/docs/reference_guide/jcef.html), JCEF is enabled according to settings & registry but when using any of the code snippets, all mentions of JBCef are marked as unresolved references, no imports suggested. What am I missing to be able to use JCEF as intended for this version of IDEA?

0
7 comments

Do you build against 2020.2 platform or later? Are you referring to classes located in package "com.intellij.ui.jcef" not resolving? Those are part of IJ platform. Please share your Gradle build file.

0

It is the 2020.2.4 Ultimate Edition to be precise. And yes, when calling

import com.intellij.ui.jcef.JBCefApp

the ui package is marked as unresolved. See my Gradle build file below:

plugins {
kotlin("jvm") version "1.4.0"
application
}
group = "com.test"
version = "1.0-SNAPSHOT"

val tornadofxVersion: String by rootProject

repositories {
mavenCentral()
}

application {
mainClassName = "mainPanel.OSPanel"
}

dependencies {
implementation("org.fxmisc.richtext:richtextfx:0.10.5")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
implementation("com.sun.mail:javax.mail:1.6.2")
implementation("org.jsoup:jsoup:1.13.1")

implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.0")
implementation(kotlin("stdlib-jdk8"))
implementation("no.tornado:tornadofx:1.7.20") //$tornadofxVersion")
testImplementation(kotlin("test-junit"))
}

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
0

Could you please share the full build.gradle? Where is `intellij` block here?

0

That is the full build.gradle, I was not aware that an 'intellij' block was required based on the official guide I linked in my original post. What exactly am I missing?

0

Are you building a plugin for IntelliJ platform or is this some standalone application?

0

It's a standalone application based in Kotlin, using JavaFX indirectly via TornadoFX

0

I see, the classes mentioned in above page are available only within the IntelliJ Platform, so they won't be usable for standalone applications.

0

Please sign in to leave a comment.