# \[error\] The operation couldn’t be completed. Unable to locate a Java Runtime

**URL:** <https://forum.ionicframework.com/t/error-the-operation-couldn-t-be-completed-unable-to-locate-a-java-runtime/232774>\
**Category:** Ionic Vue\
**Created:** [April 17, 2023, 1:19pm UTC](https://forum.ionicframework.com/t/error-the-operation-couldn-t-be-completed-unable-to-locate-a-java-runtime/232774 "2023-04-17T13:19:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![codiqa100028987](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@codiqa100028987](https://forum.ionicframework.com/u/codiqa100028987)\
**Post date:** [April 17, 2023, 1:19pm UTC](https://forum.ionicframework.com/t/error-the-operation-couldn-t-be-completed-unable-to-locate-a-java-runtime/232774/1 "2023-04-17T13:19:09Z")

</div>

Hi!

I’ve done the steps as suggested in this post:

> [@"Unable to locate a Java Runtime" error when building for Android on Mac](https://forum.ionicframework.com/t/unable-to-locate-a-java-runtime-error-when-building-for-android-on-mac/221148):
>
> The ‘run android’ command kept failing on my Mac (running Big Sur) with the following error: Running Gradle build - failed! [capacitor] [error] The operation couldn’t be completed. Unable to locate a Java Runtime. I struggled for a while with it so just wanted to share what fixed it for me: Find the SDK path in Android Studio (Android Studio \> Preferences… \> Build, Execution, Deployment \> Build Tools \> Gradle \> Gradle JDK) Set JAVA\_HOME to that path in your .zshrc or .bashrc file. For examp…

But I still get this error whenever I want to build an Android APK file from VS Code running on MacOS Ventura:

```auto
✖ Running Gradle build - failed!
[error] The operation couldn’t be completed. Unable to locate a Java Runtime.
        Please visit http://www.java.com for information on installing Java.

```

Can anyone help me to what I do from here?

Greately appreciated!

Anders

---

_[View the full topic](https://forum.ionicframework.com/t/error-the-operation-couldn-t-be-completed-unable-to-locate-a-java-runtime/232774)._
