1. Set up the project - fakeivchenko/lwjwae GitHub Wiki
Before you write any code, check what your platform needs and create a Gradle project that depends on lwjwae.
Before you begin
Make sure that you have the following:
-
Java 25 or later.
-
Gradle 9 or later. The examples use the Kotlin DSL.
-
A web engine for your platform:
Platform What you need Linux GTK 3 and WebKitGTK 4.1. On Ubuntu and Debian, install libgtk-3-0t64andlibwebkit2gtk-4.1-0.Windows Windows 10 or 11 with the WebView2 runtime. Windows 11 includes it, and Microsoft Edge installs it on Windows 10. macOS Nothing else. AppKit and WebKit are part of the system.
Create the project
-
Create a directory for the project with the following layout:
notes/ โโโ settings.gradle.kts โโโ build.gradle.kts โโโ src/main/ โโโ java/com/example/notes/Main.java โโโ resources/app/ โโโ index.html โโโ style.css -
In
settings.gradle.kts, add the lwjwae repository, where the Gradle plugin and the library are published, and name the project:pluginManagement { repositories { maven("https://repo.ivchenko.dev/releases") gradlePluginPortal() } } dependencyResolutionManagement { repositories { mavenCentral() maven("https://repo.ivchenko.dev/releases") } } rootProject.name = "notes" -
In
build.gradle.kts, apply the lwjwae Gradle plugin and name the main class:plugins { application id("dev.ivchenko.lwjwae").version("0.3.1") } java { toolchain { languageVersion = JavaLanguageVersion.of(25) } } application { mainClass = "com.example.notes.Main" }The plugin adds
lwjwae-core, the API that your code uses, and at runtime the backend of the operating system that runs the build. It also passes--enable-native-access=ALL-UNNAMEDto the JVM: lwjwae calls native code through the Foreign Function and Memory API, and the flag lets it do that without a warning. Later in the tutorial, the same plugin builds the native executable and the packages.To declare the modules yourself instead, see Use lwjwae without the plugin.
Previous: Home ยท Next: Open a window