Skip to content

Using Runtime.getRuntime().exec results in Cannot run program "": error=0, posix_spawn failed #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Sanja404 opened this issue Apr 17, 2025 · 3 comments · Fixed by #1054
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Sanja404
Copy link

Most appropriate sub-area of Processing 4?

Accessibility

Processing version

4.1.1

Operating system

MacOSX

Steps to reproduce this

Version: Processing 4.4.1
OS: macOS [specify your version, for example, 15.1.1 (24B91)]

Problem:
In Processing 4.4.1, the say command (text-to-speech via macOS) does not work, causing an error:

Copy
Cannot run program "say": error=0, posix_spawn failed
I tried all the suggested solutions (changing permissions, alternative methods via osascript), but the problem persists.

Solution:
Reverted to Processing 4.3.4 - the say function works correctly.

Suggestions:
Add a check for say compatibility with new macOS versions in Processing 4.4.1+.

Specify in the documentation that speech synthesis on macOS 15+ may require a rollback to 4.3.4.

Consider alternative methods of voicing (for example, via FreeTTS or system APIs).

Context:

Java version: 17.0.14

Tested on: Mac mini (M1/M2)

snippet

// Paste your code below :)

void setup() {

}

void draw() {

}

Additional context

No response

Would you like to work on the issue?

Is this within my capabilities?

@Sanja404 Sanja404 added the bug Something isn't working label Apr 17, 2025
@Stefterv
Copy link
Collaborator

Are you using this example: https://frontiernerds.com/text-to-speech-in-processing ?

@Stefterv
Copy link
Collaborator

Stefterv commented Apr 18, 2025

Hi @Sanja404 Thank you for raising this issue, I've looked into it and it seems to be a bug with the way we import the JDK. For now the solution is indeed to revert to 4.3.4.

We'll see if this upcoming alternative for including the JDK will solve this issue. Otherwise I will create a separate fix

@Stefterv Stefterv changed the title Problem with say in Processing 4.4.1 on macOS – revert to 4.3.4 Using Runtime.getRuntime().exec results in Cannot run program "": error=0, posix_spawn failed Apr 18, 2025
@Stefterv Stefterv self-assigned this Apr 18, 2025
@Stefterv Stefterv added this to the 4.5.0 milestone Apr 18, 2025
@SableRaf SableRaf moved this to To do in Processing Roadmap Apr 18, 2025
@Stefterv
Copy link
Collaborator

Turns out it was an issue with setting the permissions in the JDK, added the lib folder to the folders with executables and that fixed it. Will include in the next release

@github-project-automation github-project-automation bot moved this from To do to Done in Processing Roadmap Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants