# Migrate from Nucleus 2.x to 3.0

Move a Nucleus 2.x app to 3.0. Move to Compose 1.13, rename the window and tray dependencies and packages, remove the backend choice and the AWT windows, and review the runtime and build changes.

In this tutorial, you'll move a Nucleus 2.x app to 3.0. Fix the compile errors first, then review
the runtime and build changes that alter behavior without breaking the build.

## Before you start

- Bump the plugin and every `dev.nucleusframework` artifact to `3.0.0`.
- Move to Compose Multiplatform 1.13 and Kotlin 2.4.21, and use JDK 17 or later. Nucleus 3.0
  ships with Compose 1.13 and does not run on 1.12. See [Compatibility](/docs/start/install).
- If your app uses `decorated-window-jbr` or `decorated-window-jni`, plan time for
  [the AWT removal](#replace-compose-desktop-windows-dialogs-and-tray). It is the largest step.

## Review the checklist

Every breaking or behavior change in 3.0, with the step on this page and the feature page.

**Compile errors and removed APIs**

| Change | What to do | Docs |
| --- | --- | --- |
| Compose Multiplatform 1.12 is not supported. The build fails when Compose resolves to a version older than 1.13. | Apply `org.jetbrains.compose` 1.13 and remove constraints that pin Compose. [Step](#move-to-compose-113) | [Install](/docs/start/install#compatibility) |
| The `decorated-window-*` artifacts are renamed `window-*`: `decorated-window-tao` is `window-runtime`. Kotlin packages are unchanged. | Rename the dependencies you declare. [Step](#rename-the-window-modules) | [Modules](/docs/modules) |
| The `composenativetray` and `composenativetray-app` artifacts and their `dev.nucleusframework.composenativetray` packages are gone. The tray is now the `tray` and `tray-app` modules, in `dev.nucleusframework.tray`. | Swap the dependency and the imports. [Step](#move-the-tray-to-the-nucleus-tray-modules) | [System tray](/docs/os/tray) |
| `WindowPositionProvider.CenteredOnScreen` and `AlignedToScreen` are renamed, as in Compose 1.13. | Use `CenteredInScreenBounds` and `AlignedToScreenAvailableBounds`. [Step](#switch-window-state-to-the-nucleus-v2-package) | [Window state](/docs/windows/window-state) |
| `decorated-window-awt`, `-jbr`, `-jni` deleted. `NucleusBackend`, `LocalNucleusBackend`, `nucleusApplication(backend = …)` and `NucleusApplicationScope.backend` removed. | Drop the dependency and the `backend` argument. [Step](#remove-the-backend-selection) | [Windows](/docs/windows) |
| `NucleusWindowUnsafe.awtWindow` / `awtDialog` removed. Receiver-less AWT overloads of `MaterialDecoratedWindow`, `MaterialDecoratedDialog`, `JewelDecoratedWindow`, `JewelDecoratedDialog` removed. | Use `unsafe.taoWindow` and the `NucleusApplicationScope` receivers. [Step](#remove-the-backend-selection) | [Toolkits](/docs/toolkits) |
| Compose Desktop's AWT `Window`, `DialogWindow` and `Tray` are unsupported. `SwingPanel` and AWT `Canvas` embedding fail at runtime. | Import `Window` and `DialogWindow` from `dev.nucleusframework.application`, or use `DecoratedWindow`, `DecoratedDialog`, `HostedWindow` / `HostedDialog`. Use the Nucleus `tray` module and `NativeView`. [Step](#replace-compose-desktop-windows-dialogs-and-tray) | [Dialogs and popups](/docs/windows/dialogs-popups) |
| Compose's `androidx.compose.ui.window.v2` types are not accepted. | Import `dev.nucleusframework.window.tao.v2` instead. [Step](#switch-window-state-to-the-nucleus-v2-package) | [Window state](/docs/windows/window-state) |
| `NucleusWindowHost.Window` takes two new parameters, `minimizable` and `maximizable`. | Add them to your themed host. [Step](#update-custom-window-hosts) | [Toolkits](/docs/toolkits) |
| Pre-release tool window APIs renamed: `SatelliteDragKind` is `WorkspaceDragKind`, `TabDropGhost.title` is `TabDropGhost.tab`. The family requires an opt-in. | Rename, then opt in to `ExperimentalNucleusApi`. [Step](#opt-in-to-the-tool-window-apis) | [Tool windows](/docs/tool-windows) |
| `TaoMouseButton.OTHER` is now `5`; `3` and `4` are `BACK` and `FORWARD`. | Recompile code that reads raw Tao mouse button codes. | [Mouse buttons](/docs/input/mouse-buttons) |
| `macOS.appStore` and `TargetFormat.isStoreFormat` no longer compile. | Use `macOS { pkg { appStore = … } }` and `ExecutableRuntime.isSandboxed()`. [Step](#replace-the-pkg-store-flags) | [macOS packaging](/docs/packaging/macos) |
| `GitHubProvider(owner, repo, token)` no longer compiles. | Drop the token for a public repository, or use `PrivateGitHubProvider(owner, repo, token)`. [Step](#move-private-repositories-to-privategithubprovider) | [Auto-update](/docs/packaging/auto-update#read-updates-from-github-releases) |
| `TabHoverPreview.nativeLayer` removed. | Delete the argument. Open the tab windows with `nativePopupLayers = true` to let the card hang outside the window. [Step](#update-tab-hover-previews) | [Tabs](/docs/tool-windows/tabs#draw-previews) |

**Runtime behavior changes**

| Change | What to do | Docs |
| --- | --- | --- |
| Cmd+Q and Dock → Quit call every window's `onCloseRequest`. | Check that your close handlers exit or close. [Step](#check-your-close-handlers) | [Application](/docs/lifecycle/application) |
| Notification, media control, launcher and global hotkey callbacks run on the host UI thread, not the AWT EDT or a native thread. | Remove Swing assumptions in those callbacks. [Step](#move-native-callbacks-off-the-awt-edt) | [Threading](/docs/concepts/threading) |
| Trackpad pinch arrives as `PointerEventType.ScaleStart` / `ScaleChange` / `ScaleEnd`. | Move pinch code to `Modifier.transformable` or a Scale listener. [Step](#handle-pinch-and-pan-events) | [Trackpad gestures](/docs/input/trackpad-gestures) |
| macOS trackpad and Windows precision-touchpad scrolling arrive as `PanStart` / `PanMove` / `PanEnd`. | Handle Pan in custom `Scroll` handlers. [Step](#handle-pinch-and-pan-events) | [Trackpad gestures](/docs/input/trackpad-gestures) |
| Single instance is off in dev runs. | Pass `enableSingleInstance = true` to test it from `run`. [Step](#test-single-instance-in-dev-runs) | [Single instance](/docs/lifecycle/single-instance) |
| `nucleusApplication` initializes FileKit with `NucleusApp.appId`. | Check your FileKit data directory, or opt out. [Step](#check-the-filekit-initialization) | [File dialogs](/docs/os/file-dialogs) |
| Windows: a hung event loop logs `SEVERE` with a thread dump. | Hook the callbacks or mark long work. [Step](#handle-the-event-loop-watchdog) | [Application](/docs/lifecycle/application) |
| Windows: opaque windows render text with LCD (ClearType) antialiasing. | Update screenshot baselines, or opt out. [Step](#review-lcd-text-on-windows) | [HiDPI](/docs/windows/hidpi) |
| JRE fonts are stripped from jlink runtime images. | Keep them if you draw text through AWT or Swing. [Step](#keep-jre-fonts-for-awt-text) | [Configuration](/docs/start/configuration) |
| Nucleus JNI libraries ship next to the packaged app, not inside its JARs. | Load them through `NativeLibraryLoader`, not as resources. [Step](#load-nucleus-native-libraries-through-the-loader) | [Packaging](/docs/packaging) |
| Windows NSIS installs keep the runtime and app in `versions\<version>\`, and `installAndRestart` updates without closing the app. | Don't build paths from the install root. Call `UpdateHandoff.signalReady()` if the app shows no Nucleus window. | [Auto-update](/docs/packaging/auto-update#update-without-closing-the-app-on-windows) |
| `ExecutableRuntime.isSandboxed()` returns `false` in an AppX package. | Test `ExecutableRuntime.isAppX()` to detect AppX. [Step](#detect-appx-with-isappx) | [Executable type](/docs/lifecycle/executable-type) |
| Tray menu labels are literal: `&` and `_` are no longer mnemonics, and a `-` label is an item, not a separator. | Use `Divider()` for separators and drop mnemonic markers. [Step](#move-the-tray-to-the-nucleus-tray-modules) | [Tray menu](/docs/os/tray/menu) |
| `TaoWindow.setOuterPosition` throws `IllegalArgumentException` for NaN, infinite or out-of-range positions (beyond ±1,000,000 dp). | Don't pass sentinels such as `Int.MIN_VALUE` as a window position. | [Window state](/docs/windows/window-state) |

**Build and CI changes**

| Change | What to do | Docs |
| --- | --- | --- |
| The plugin downloads Node.js for packaging. | Drop `setup-node` from CI and cache the download. [Step](#drop-nodejs-from-ci) | [CI/CD](/docs/packaging/ci-cd) |
| `nucleusOptimization` and its `lastJdk` knob are opt-in. `lastJdk` downloads OpenJDK 27. | Turn them on if you want them. [Step](#opt-in-to-the-startup-pack) | [Performance](/docs/performance) |

**New in 3.0, no action required**

| Change | When it matters | Docs |
| --- | --- | --- |
| `TaoWindow.canPlaceOnScreen` and `SatelliteScope.isCompositorPlaced` report native Wayland placement. | Chrome that reads window positions on Linux. [Step](#opt-in-to-the-tool-window-apis) | [Linux and Wayland](/docs/windows/linux-wayland) |
| `nucleusApplication(exitProcessOnExit = true)` is the default. | Pass `false` to keep running after the last window. | [Application](/docs/lifecycle/application) |
| `-Dnucleus.native.cacheDir` and `NativeLibraryLoader.cacheDirectory` relocate the native library cache. | Fat JARs, IDE runs, distributions built without the plugin. [Step](#load-nucleus-native-libraries-through-the-loader) | [Packaging](/docs/packaging) |

## Move to Compose 1.13

Nucleus 3.0 is built against Compose Multiplatform 1.13 internals, so it fails at run time on 1.12
with `NoClassDefFoundError` or `NoSuchMethodError`. The plugin checks it at build time instead.

1. Bump the Compose plugin and Kotlin:

   ```diff title="build.gradle.kts"
    plugins {
   -    kotlin("jvm") version "2.4.20"
   -    kotlin("plugin.compose") version "2.4.20"
   -    id("org.jetbrains.compose") version "1.12.1"
   +    kotlin("jvm") version "2.4.21"
   +    kotlin("plugin.compose") version "2.4.21"
   +    id("org.jetbrains.compose") version "1.13.0"
        id("dev.nucleusframework") version "3.0.0"
    }
   ```

2. Remove `strictly`, `force` or BOM constraints that hold `org.jetbrains.compose.ui:ui-desktop`
   below 1.13. If one is left, the build fails with `Nucleus requires Compose Multiplatform 1.13 or
   newer`.
3. Bump the libraries that follow Compose, such as Material 3 and Jewel. The Jewel adapter is built
   against Jewel `0.43.0-263.8311.126`. See [Jewel](/docs/toolkits/jewel).

An `org.jetbrains.compose` plugin older than 1.13 only logs a warning, because Gradle upgrades the
Compose libraries anyway. Upgrade it all the same: it injects a Compose Hot Reload agent that Tao
does not support.

## Rename the window modules

`decorated-window-tao` is the only window runtime, not one decoration among several, so the
`decorated-window-*` family is now `window-*`. Only the Gradle coordinates move: the Kotlin packages
and the imports stay the same.

| Nucleus 2.x | Nucleus 3.0 |
| --- | --- |
| `nucleus.decorated-window-tao` | `nucleus.window-runtime` |
| `nucleus.decorated-window-core` | `nucleus.window-core` |
| `nucleus.decorated-window-jewel` | `nucleus.window-jewel` |
| `nucleus.decorated-window-material2` | `nucleus.window-material2` |
| `nucleus.decorated-window-material3` | `nucleus.window-material3` |

```diff title="build.gradle.kts"
 dependencies {
     implementation("dev.nucleusframework:nucleus.nucleus-application:3.0.0")
-    implementation("dev.nucleusframework:nucleus.decorated-window-material3:3.0.0")
+    implementation("dev.nucleusframework:nucleus.window-material3:3.0.0")
 }
```

An app that only depends on `nucleus-application` gets `window-runtime` and `window-core`
transitively and has nothing to rename. Also rename the modules in version catalogs, dependency
locks, `exclude(module = …)` rules and GraalVM or ProGuard configuration.

## Remove the backend selection

Tao is the only window runtime in 3.0, and `nucleus-application` brings it along.

1. Remove `decorated-window-jbr`, `decorated-window-jni`, `decorated-window-awt` and
   `decorated-window-tao` (now `window-runtime`) from every module's dependencies.
2. Drop the `backend` argument and the `NucleusBackend` import. Delete reads of
   `LocalNucleusBackend` and `NucleusApplicationScope.backend`, and keep the Tao branch of
   backend-specific code:

   ```diff
   -fun main(args: Array<String>) = nucleusApplication(args, backend = NucleusBackend.Tao) {
   +fun main(args: Array<String>) = nucleusApplication(args) {
   ```

3. Replace `nucleusWindow.unsafe.awtWindow` with `unsafe.taoWindow`, or `unsafe.taoHandle` for the
   native handle. Check `NucleusWindow` first: `toFront()`, `setMinimumSize()`, `setIcon()` and
   `boundsOnScreen()` cover most calls.
4. Call the Material and Jewel windows and dialogs on a `NucleusApplicationScope`, because the
   receiver-less AWT overloads are gone. Inside `nucleusApplication { }` nothing changes. Deeper in
   the composition, read the scope from `LocalNucleusApplicationScope`:

   ```kotlin
   val scope = LocalNucleusApplicationScope.current
   scope.MaterialDecoratedWindow(onCloseRequest = onClose, title = "Editor") { EditorContent() }
   ```

## Replace Compose Desktop windows, dialogs, and tray

Nucleus 3.0 never creates an AWT window, so Compose Desktop's `Window`, `DialogWindow` and `Tray`
fail under `nucleusApplication`. Swap each for its Nucleus counterpart:

| Compose Desktop (AWT) | Nucleus 3.0 |
| --- | --- |
| `Window(…)` | `Window(…)` from `dev.nucleusframework.application`, `DecoratedWindow(…)` for a Compose title bar, or `HostedWindow(…)` in library code |
| `DialogWindow(…)` | `DialogWindow(…)` from `dev.nucleusframework.application`, `DecoratedDialog(…)`, or `HostedDialog(…)` in library code |
| `Tray(…)` from `androidx.compose.ui.window` | `Tray(…)` from the [Nucleus `tray` module](/docs/os/tray) |
| `SwingPanel`, AWT `Canvas` | [`NativeView`](/docs/native-content/native-views) |
| `JFileChooser`, `java.awt.FileDialog` | [FileKit](/docs/os/file-dialogs) |
| `window.window` (`ComposeWindow`) | `nucleusWindow` and `LocalNucleusWindow` |

The Nucleus `Window` and `DialogWindow` take Compose's parameters, so the import is the only change.
The platform draws their title bar. If a file also imports `androidx.compose.ui.window.*`, import
`dev.nucleusframework.application.Window` explicitly, or the call is ambiguous. See
[Choose a window kind](/docs/windows#choose-a-window-kind).

`DecoratedWindow` and `DecoratedDialog` take the same `onCloseRequest` and `title` arguments, and
draw the title bar in Compose. `HostedWindow` and `HostedDialog` wear the toolkit the app provides, so a library does not pick a
look.

For the tray, add `dev.nucleusframework:nucleus.tray:3.0.0` and import
`dev.nucleusframework.tray.Tray`. Its API differs from Compose's `Tray`, so port the menu with the
[tray menu DSL](/docs/os/tray/menu).

AWT classes that don't need a window keep working: `BufferedImage`, `ImageIO`, `java.awt.Font`,
and the AWT clipboard. APIs that need a window or the AWT event loop do not.

## Move the tray to the Nucleus tray modules

ComposeNativeTray now lives in Nucleus, split in two modules that share the Nucleus version:

- `tray` (`dev.nucleusframework:nucleus.tray`): the icon, the native menu and the `Tray(…)`
  composables. It needs no window runtime, so a daemon or an app without windows can use it.
- `tray-app` (`dev.nucleusframework:nucleus.tray-app`): `TrayApp`, the icon that toggles a popup
  anchored to it. It brings `tray` and `nucleus-application`.

1. Replace the dependency:

   ```diff title="build.gradle.kts"
    dependencies {
   -    implementation("dev.nucleusframework:composenativetray:<tray-version>")
   -    implementation("dev.nucleusframework:composenativetray-app:<tray-version>")
   +    implementation("dev.nucleusframework:nucleus.tray:3.0.0")
   +    // Only if you use TrayApp
   +    implementation("dev.nucleusframework:nucleus.tray-app:3.0.0")
    }
   ```

2. Replace the imports. The `.api` segments are gone and `trayapp` is now `tray.app`:

   | ComposeNativeTray | Nucleus 3.0 |
   | --- | --- |
   | `dev.nucleusframework.composenativetray.tray.api.Tray` | `dev.nucleusframework.tray.Tray` |
   | `dev.nucleusframework.composenativetray.menu.api.*` (`Key`, `KeyShortcut`) | `dev.nucleusframework.tray.menu.*` |
   | `dev.nucleusframework.composenativetray.trayapp.*` (`TrayApp`, `rememberTrayAppState`) | `dev.nucleusframework.tray.app.*` |

   ```diff
   -import dev.nucleusframework.composenativetray.tray.api.Tray
   -import dev.nucleusframework.composenativetray.trayapp.TrayApp
   +import dev.nucleusframework.tray.Tray
   +import dev.nucleusframework.tray.app.TrayApp
   ```

3. Check the menu labels. They are shown as written: `&` (Windows) and `_` (Linux) are no longer
   eaten as mnemonics, and a `-` label is a plain item. Use `Divider()` for separators.

Under GNOME, the AppIndicator extension opens the menu on a single click and calls the primary
action on a double click, so a `TrayApp` popup opens on a double click there. See
[System tray](/docs/os/tray).

## Switch window state to the Nucleus v2 package

Compose 1.13's window API v2 depends on AWT, so Nucleus ships a copy with the same members.
Change the import of `rememberWindowState`, `WindowState`, `DialogState`, `Screen`, the geometry
providers and the `remember*` factories:

```diff
-import androidx.compose.ui.window.v2.rememberWindowState
+import dev.nucleusframework.window.tao.v2.rememberWindowState
```

Compose 1.13 renamed two position providers, and Nucleus follows:

```diff
-positionProvider = WindowPositionProvider.CenteredOnScreen,
+positionProvider = WindowPositionProvider.CenteredInScreenBounds,
-positionProvider = WindowPositionProvider.AlignedToScreen(Alignment.TopEnd),
+positionProvider = WindowPositionProvider.AlignedToScreenAvailableBounds(Alignment.TopEnd),
```

The v1 `androidx.compose.ui.window.WindowState` keeps working. See
[Window state](/docs/windows/window-state).

## Update custom window hosts

`NucleusWindowHost.Window` takes `minimizable: Boolean` and `maximizable: Boolean` after
`resizable`. A themed host must add both and pass them on. They default to `true` on
`DecoratedWindow` and `HostedWindow`, and `DecoratedDialog` passes `false`. `NucleusDialogHost` is
unchanged.

## Opt in to the tool window APIs

Satellites, the dock layout and tabs are `@ExperimentalNucleusApi` at `ERROR` level. Opt in per
call site or per module:

```kotlin title="build.gradle.kts"
kotlin {
    compilerOptions {
        optIn.add("dev.nucleusframework.window.ExperimentalNucleusApi")
    }
}
```

If you used a pre-release build, rename `SatelliteDragKind` to `WorkspaceDragKind` (it now serves
both workspaces) and `dropGhost.title` to `dropGhost.tab.title`.

On native Wayland, the app can neither read nor set window screen positions. Branch on
`TaoWindow.canPlaceOnScreen` (or `SatelliteScope.isCompositorPlaced` in a satellite), not on the
compositor name. See [Linux and Wayland](/docs/windows/linux-wayland).

## Replace the PKG store flags

A PKG now targets either the Mac App Store or Developer ID. Move the flag into the `pkg { }` block:

```diff title="build.gradle.kts"
 macOS {
-    appStore = true
+    pkg { appStore = true } // default; false builds a Developer ID PKG
 }
```

In runtime code, replace `ExecutableRuntime.isPkg()` and `isStoreFormat` checks with
`ExecutableRuntime.isSandboxed()`. A Developer ID PKG is not sandboxed, so it can update itself.
See [Sandboxing](/docs/packaging/sandboxing).

## Move private repositories to PrivateGitHubProvider

`GitHubProvider` takes no token in 3.0, so `GitHubProvider(owner, repo, token)` no longer
compiles. For a public repository, drop the token. For a private repository or a GitHub Enterprise
Server, switch to `PrivateGitHubProvider`:

```diff
-provider = GitHubProvider(owner = "myorg", repo = "myapp", token = token)
+provider = PrivateGitHubProvider(owner = "myorg", repo = "myapp", token = token)
```

Pass `host` by name. See
[Read updates from GitHub Releases](/docs/packaging/auto-update#read-updates-from-github-releases).

## Update tab hover previews

`TabHoverPreview` lost its `nativeLayer` parameter. Delete the argument. The card now opens like
the window's other popups: in the windows `TabWindows` opens, it draws inside the window, clipped by
it. To let it hang below the window, open the tab windows yourself with `nativePopupLayers = true`.
See [Draw previews](/docs/tool-windows/tabs#draw-previews).

## Review runtime behavior changes

These changes compile without errors. Check each one against your app.

### Check your close handlers

On macOS, Cmd+Q and Dock → Quit now call `onCloseRequest` on every open window, as on Windows and
Linux. A handler that neither calls `exitApplication()` nor closes its window cancels the quit. A
hide-to-tray handler lets the quit through while `NucleusApplicationScope.isQuitting` is `true`.
See [Application](/docs/lifecycle/application).

### Move native callbacks off the AWT EDT

`notification-linux`, `notification-windows`, `media-control`, `launcher-linux` and
`launcher-macos` callbacks run on the host UI thread. Compose state writes keep working. Remove
`SwingUtilities.isEventDispatchThread()` checks and Swing calls from them. See
[Threading](/docs/concepts/threading).

### Handle pinch and pan events

A trackpad pinch or Ctrl+wheel arrives as `ScaleStart` / `ScaleChange` / `ScaleEnd`, which
`detectTransformGestures` does not see: use `Modifier.transformable`. On macOS and
on a Windows precision touchpad, scrolling arrives as `PanStart` / `PanMove` / `PanEnd`. `Modifier.scrollable` handles it,
but a custom `Scroll` handler must handle Pan too:

```kotlin
when (event.type) {
    PointerEventType.Scroll -> offset += change.scrollDelta * stepPx
    PointerEventType.PanMove -> offset += change.panOffset
    PointerEventType.ScaleChange -> zoom *= change.scaleFactor
}
```

`-Dnucleus.tao.trackpadPanEvents=false` sends trackpad scrolling as `Scroll`. See
[Trackpad gestures](/docs/input/trackpad-gestures).

### Test single instance in dev runs

A second `./gradlew run` or IDE launch now starts a separate instance. Packaged builds keep the
lock. To test the forwarding from `run`, pass `nucleusApplication(args, enableSingleInstance = true)`.

### Check the FileKit initialization

When FileKit is on the classpath, `nucleusApplication` calls `FileKit.init(NucleusApp.appId)`, so
dev runs, packaged apps and native images share one data directory. A `FileKit.init` call before
`nucleusApplication` keeps your configuration. Pass `initializeFileKit = false` to leave FileKit
untouched.

### Handle the event-loop watchdog

On Windows, a stuck event loop now logs `SEVERE` with a thread dump. Show your own UI from the
callbacks, and wrap known long synchronous work so it is not reported:

```kotlin
nucleusApplication(args) {
    onUnresponsive { showWaitOrQuit() }
    onResponsive { hideWaitOrQuit() }
    expectUnresponsive { importHugeProjectSynchronously() }
}
```

`-Dnucleus.tao.watchdog=false` disables the watchdog.

### Review LCD text on Windows

Opaque windows on Windows now render text with ClearType antialiasing, which changes screenshots.
Update your baselines, or opt out with `-Dnucleus.text.lcd=false` at run time or
`-Pnucleus.text.lcd.patch=false` at build time.

### Keep JRE fonts for AWT text

The jlink runtime image no longer ships the JRE fonts, because Compose draws with its own. If you
render text through AWT or Swing, set `stripJreFonts = false` in `nativeDistributions`.

### Load Nucleus native libraries through the loader

Packaged apps carry Nucleus JNI libraries next to the app instead of inside the module JARs. Code
that read them as JAR resources must call `NativeLibraryLoader.load(…)`. Your own libraries under
`nucleus/native/` stay in their JARs.

### Detect AppX with isAppX

An AppX package runs with full trust, so `ExecutableRuntime.isSandboxed()` now returns `false`
there. Code that relied on `isSandboxed()` to detect AppX must test `ExecutableRuntime.isAppX()`.
See [Build an AppX or MSIX package](/docs/packaging/windows#build-an-appx-or-msix-package).

## Update the build and CI

### Drop Node.js from CI

The plugin downloads the Node.js that packaging needs. Remove `actions/setup-node` from your
workflows and add `~/.gradle/nucleus/nodejs` to your cache paths. To keep the `node` on `PATH`,
set `nodejs { autoDownload = false }` in `nativeDistributions`. See [CI/CD](/docs/packaging/ci-cd).

### Opt in to the startup pack

`nucleusOptimization` is off by default. One switch turns on Serial GC, a compact heap, a single
runtime JAR, idle GC and `lastJdk` (OpenJDK 27). Override single knobs in the block:

```kotlin title="build.gradle.kts"
nucleus.application {
    nucleusOptimization = true
    nucleusOptimization { lastJdk = false }
}
```

An explicit `javaHome` wins over `lastJdk`. See [Performance](/docs/performance).

## Retest the app

Run the app, then exercise each integration that used to depend on AWT:

- **Drag and drop.** Rewrite handlers that read AWT `TransferHandler` data. See
  [Drag and drop](/docs/input/drag-and-drop).
- **Deep links.** `onDeepLink { uri -> … }` is unchanged.
- **File dialogs and embedded views.** Check every FileKit picker and `NativeView`.
- **Window placement on Linux.** Wayland compositors ignore absolute positions.
- **Quit flows** on macOS, and every close handler.
- **Packaging.** Build each installer format once, and a native image if you ship one.

- `core-runtime` still has `WindowBackend.Awt`. It describes a Compose Desktop or Swing app that
  embeds Nucleus libraries without `nucleusApplication`, and has no effect on a Nucleus app.
- `macOS.appStore` fails at `ERROR` level instead of acting as an alias: 2.x ignored it, so an
  alias would have switched existing builds to the other channel.
- Pinch used to arrive as two synthetic touch contacts. Rotation still does.
- A `FileKit.init` call inside `content` replaces the automatic one.
- The watchdog callbacks run on a dedicated thread. `-Dnucleus.tao.watchdogGraceMs=<ms>` changes
  the grace period, and `-Dnucleus.tao.watchdogDialog=true` also shows the native dialog.
- Transparent windows, popups, Mica and Acrylic keep grayscale text.
- Only the jlink image drops the JRE fonts. `run` and GraalVM native images are unaffected.
- Fat JARs, IDE runs and distributions built without the plugin still extract native libraries to
  a cache. Relocate it with `-Dnucleus.native.cacheDir=<dir>`, or set
  `NativeLibraryLoader.cacheDirectory` in `main()` before the first native library loads.
- `compose.electronBuilder.nodePath` and `NUCLEUS_NODE_HOME` take precedence over the Node.js
  download.
- `lastJdk` downloads the JDK the first time a packaging or `run` task needs it, and falls back to
  BellSoft Liberica on Intel Macs and Windows ARM.

## What's next

- [Windows](/docs/windows): `nucleusApplication`, `Window` and `DecoratedWindow` in 3.0.
- [System tray](/docs/os/tray): the `tray` and `tray-app` modules.
- [Window state](/docs/windows/window-state): the AWT-free window API v2.
- [Tool windows](/docs/tool-windows): satellites, docking and tabs.
- [Migrate with an AI agent](/docs/migrate/ai-agent): let an agent apply this checklist.
