Skip to content

Generating Apple Silicon App fails with Processing 4.5.7 on macOS 27.0.1 #1577

Closed as duplicate

Description

@svedblen

Most appropriate sub-area of Processing 4?

Export

Processing version

4.5.7

Operating system

macOS

Bug description

I am running macOS 27.0.1 on Applie silicon, and have just upgraded Processing to version 4.5.7. I now have problem generating apps from Processing sketches. Processing itself fails at JavaBuild.java:762 and prints a stack dump during app generation, and the produced app is not usable. I'll attach the dump below.

The same sketches run fine when run inside Processing and it no problem generating the apps from the very same (untouched) sketches with Processing 4.0.1.

If I untick "Include Java in the ..." the export works fine.

Also, if I attempt to generate an app (using version 4.5.7) for Linux everything seems to go fine (no dump).

Stack dump here:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Unknown Source)
at processing.mode.java.JavaBuild.exportApplication(JavaBuild.java:762)
at processing.mode.java.JavaBuild.exportApplication(JavaBuild.java:606)
at processing.mode.java.JavaMode.handleExportApplication(JavaMode.java:184)
at processing.mode.java.JavaEditor.lambda$handleExportApplication$21(JavaEditor.java:491)
at processing.app.ui.ExportPrompt.trigger(ExportPrompt.java:345)
at processing.mode.java.JavaEditor.handleExportApplication(JavaEditor.java:500)
at processing.mode.java.JavaEditor.lambda$buildFileMenu$0(JavaEditor.java:223)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at java.desktop/javax.swing.AbstractButton.doClick(Unknown Source)
at java.desktop/com.apple.laf.ScreenMenuItem.actionPerformed(Unknown Source)
at java.desktop/java.awt.MenuItem.processActionEvent(Unknown Source)
at java.desktop/java.awt.MenuItem.processEvent(Unknown Source)
at java.desktop/java.awt.MenuComponent.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.MenuComponent.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Steps to reproduce this

  1. Sketch in Processing 4.5.7 (ringning fine inside Processing)
  2. Select Export, macOS (Apple Silicon)
  3. Tick "Include Java in the..."
  4. Selected "Export"

snippet

No response

Additional context

No response

Would you like to work on the issue?

No, I’m just reporting the issue

Activity

  1. chaitanya-bhardwaj commented on Oct 7, 2026

    @chaitanya-bhardwaj
    Contributor

    I tracked down where this fails.

    In JavaBuild.java exporting for macOS with embedded Java looks for the bundled JDK in compose.application.resources.dir:

    var jdk = Files.list(new File(resources).toPath())
            .filter(Files::isDirectory)
            .filter(p -> p.getFileName().toString().startsWith("jdk-"))
            .findFirst()
            .orElseThrow();

    The filter expects the folder name to start with "jdk-". In the Gradle build (app/build.gradle.kts), the bundled JDK is placed in composeResources("jdk"), so the directory is named "jdk". Because it does not start with "jdk-", findFirst() is empty and orElseThrow() throws NoSuchElementException.

    We can update the filter in JavaBuild.java to accept "jdk" as well as "jdk-", matching how Platform.getJavaHome() resolves it, and show a clear error message if the directory is missing.

    does this approach look ok?

  2. SableRaf commented on Oct 7, 2026

    @SableRaf
    Collaborator

    This looks like a duplicate of #1141, so I’ll close this to keep the discussion in one place. Please continue the discussion there.

    @Chaitanya-970, check out those issues first. #1141 identified the same jdk- / jdk mismatch, but it looks like the issue goes deeper. #1354 also has some investigation into where the regression was introduced.

  3. chaitanya-bhardwaj commented on Oct 7, 2026

    @chaitanya-bhardwaj
    Contributor

    noted @SableRaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions