Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac The operation couldn’t be completed. Unable to locate a Java Runtime that supports jarsigner

Tags:

java

jarsigner

My purpose is to use jarsigner to sign apk.

I get the following prompt:

% jarsigner     
The operation couldn’t be completed. Unable to locate a Java Runtime that supports jarsigner.
Please visit http://www.java.com for information on installing Java.

my java version hint:

% java -version
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Mac version is 11.6.3

How can I solve this problem please?

like image 687
gaohomway Avatar asked Sep 01 '25 01:09

gaohomway


2 Answers

Mac users, follow the below steps:

  1. brew install openjdk@11
    
  2. For the system Java wrappers to find this JDK, symlink it with:
    sudo ln -sfn $(brew --prefix)/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
    

Reference: https://formulae.brew.sh/formula/openjdk@11

This approach will also work for other versions.

like image 187
Polo Avatar answered Sep 02 '25 14:09

Polo


I finally solved it by downloading the JDK

like image 31
gaohomway Avatar answered Sep 02 '25 15:09

gaohomway