macOS exported application "Unable to load java runtime environment"

Hello there,

I have run into trouble with my exported sketch. I hope this is the right place for this.

If I click on the exported app I get the warning “Unable to load java runtime environment”.
But if I open the executable inside the application package the sketch runs without any hiccups.

The exported sketch doesn’t rely on any added Libraries. And it doesn’t make a difference if I include Java on export or not.
EDIT:
If I don’t include Java on export, even the executable doesn’t run and throws this error. So maybe it is a problem with my Java installation?
EDIT 2:
So I have removed the existing JDKs (18 and 17) through Terminal and installed the version that’s shown in the export window and performed a restart.

~ % java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode)

Still no luck getting the application to run…

void setup() {
  size(600, 900);  
}

void draw() {
  background(0,0,255);
  circle(width/2,height/2,100);
}
  • macOS 12.4 Monterey
  • Processing 4.0b8
  • MacBook Pro M1

Thank you for your time :slight_smile:

Hi,
i ve the same configuration, but no problems on export.
i got this in terminal:
$ java -version
java version “16.0.2” 2021-07-20
Java™ SE Runtime Environment (build 16.0.2+7-67)
Java HotSpot™ 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
with $PATH, i don’t see anything related to java

i don’t know what else to test
if i export example/color/hue the hue.app is : 6 857 203 octets (6,9 Mo sur disque)
may be it can give an hint if size is different…
ask me if you know something else i can try

Nothing to add here except that I’m having the exact same issue on my m1 Mac.

hi,
it s strange, here is what i can think of:
did you downloaded the “apple silicon” version of it?
did you move it out of the “download” directory (can be a limitation for some app)
do you see the needed authorizations in macos parameters/security/confidentiality, mainly the disk access part?
is it the same with processing 3.5.4 ?
problem occur with any sketch?

Hi th75,

thanks for trying to help!
If I export the hue example from the processing website the resulting app is 7.063.803 Bytes large. Not sure what to make of that.
Yes to All on your second post I am afraid…

What I discovered is that in the Info.plist file, the path that is supposed to point to the Java library does not exist in my application package…

<string>-Djava.library.path=$APP_ROOT/Contents/Java:$APP_ROOT/Contents/Java/core/library</string>

I think the library files are stored inside the Plugins Folder…
I tried to make the corresponding path inside the /Contents/Java Folder and copying the lib files over. I also tried changing the path of the Info.plist file, but both did not work.



Maybe you could check if the path points in the right directory inside your exported application?

Hi Juno, I am sorry but it feels comforting knowing that I am not alone with this :smiling_face_with_tear:

I did open a issue on GitHub here:

hi,
i ve the same info.plist
but, didn’t notice that, java is included only on the x86 version, apple silicon app doesn’t get it, i guess it s where it fail on your side, it can find a compatible apple silicon version of java on your machine.
i don’t remember what i did with java installation, i installed zulu arm64 java a long time ago :thinking:

if i do: which java
in terminal, i get:
/usr/bin/java
where i see a full java install
however, if i launch the apple silicon app, and look in “acitivity monitor” , all files related to java come from : /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/
i guess you need to check your arm64 java installation…but i’m already far out of my comfort zone here…
do your export of "macos intel " with embeded java, work fine as a workaround?

Good news! This is fixed in beta 9. (which is coming very soon).

Comment here:

1 Like