# macOS exported application "Unable to load java runtime environment"

**URL:** <https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136>\
**Category:** Processing\
**Created:** [July 28, 2022, 9:31am UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136 "2022-07-28T09:31:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![clauscarnival](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clauscarnival/32/16717_2.png) [@clauscarnival](https://discourse.processing.org/u/clauscarnival)\
**Post date:** [July 28, 2022, 9:31am UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/1 "2022-07-28T09:31:11Z")

</div>

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…

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![th75](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@th75](https://discourse.processing.org/u/th75)\
**Post date:** [July 31, 2022, 12:50am UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/2 "2022-07-31T00:50:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![juno](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@juno](https://discourse.processing.org/u/juno)\
**Post date:** [August 3, 2022, 6:24am UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/3 "2022-08-03T06:24:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![th75](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@th75](https://discourse.processing.org/u/th75)\
**Post date:** [August 3, 2022, 1:57pm UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/4 "2022-08-03T13:57:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![clauscarnival](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clauscarnival/32/16717_2.png) [@clauscarnival](https://discourse.processing.org/u/clauscarnival)\
**Post date:** [August 3, 2022, 2:34pm UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/5 "2022-08-03T14:34:41Z")

</div>

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…

```auto
<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.

 ![Bildschirmfoto 2022-08-03 um 16.36.48 Kopie](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/8/e85dcf0ece78027fe81411df7d852ba7b6d27c48.jpeg)  
 ![Bildschirmfoto 2022-08-03 um 16.37.22 Kopie](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/e/7ea273f1e5b3b1f41a2f0496724016ec988f834c.jpeg)  
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 🥲

---

<div class="post-metadata">

**Author:** ![juno](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@juno](https://discourse.processing.org/u/juno)\
**Post date:** [August 3, 2022, 5:50pm UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/6 "2022-08-03T17:50:37Z")

</div>

I did open a issue on GitHub here:

> <https://github.com/processing/processing4/issues/526>
>
> Platform: macOS Monterey 12.4 Apple M1.
> Issue Description: Export Application d…isplays "Unable to load Java Runtime Environment" error after attempting to run application
> The Fix/Solution: Show package contents and navigate to contents/macOS, launch app and will run successfully
> Step to Reproduce: Export app on m1 Mac and select include java runtime. 
> 
> Additional details reported in official forums:
> https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/5

---

<div class="post-metadata">

**Author:** ![th75](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@th75](https://discourse.processing.org/u/th75)\
**Post date:** [August 4, 2022, 12:05pm UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/7 "2022-08-04T12:05:42Z")

</div>

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 🤔

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?

---

<div class="post-metadata">

**Author:** ![juno](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@juno](https://discourse.processing.org/u/juno)\
**Post date:** [August 4, 2022, 10:37pm UTC](https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/8 "2022-08-04T22:37:16Z")

</div>

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

Comment here:

> <https://github.com/processing/processing4/issues/526>
>
> Platform: macOS Monterey 12.4 Apple M1.
> Issue Description: Export Application d…isplays "Unable to load Java Runtime Environment" error after attempting to run application
> The Fix/Solution: Show package contents and navigate to contents/macOS, launch app and will run successfully
> Step to Reproduce: Export app on m1 Mac and select include java runtime. 
> 
> Additional details reported in official forums:
> https://discourse.processing.org/t/macos-exported-application-unable-to-load-java-runtime-environment/38136/5
