Where is jarsigner?

JavaAndroid

Java Problem Overview


I have the Android SDK installed on both a Linux machine using open SuSE 12.1. I've used both machines to successfully build Android apps many times and sign them both with a debug key for testing and a release key from my own keystore, so it should be somewhere on each machine.

Using the command

jarsigner

Returns a command not found error on both machines, however. I've looked in the Android SDK folder, JDK folder on Windows, and /usr/lib64/jvm/ but it's not anywhere I've looked.

I assume it must be under a different name. I've also run:

 find -name jarsigner

over the whole system on the Linux box with no success.

Java Solutions


Solution 1 - Java

It's in the bin folder of your java JDK install (Java SE). If you only have the JRE installed you probably don't have it.

Solution 2 - Java

%JAVA_HOME%\bin\jarsigner

You can find jarsigner there. Install jdk first.

Solution 3 - Java

For posterity's sake, if you are trying to actually use jarsigner to sign a jar file (such as that of an applet) with a keystore, you'll need to reference jarsigner while running the command from the folder that your keystore is in:

cd "C:\Program Files\Java\jre(version#)\bin"

then

"C:\Program Files\Java\jdk(version#)\bin\jarsigner.exe" -keystore mykeystore (PATH TO YOUR .JAR)\MyJarFile.jar alias

The above might be obvious, but it took me a few tries because I was trying to call jarsigner while inside the JDK folder, which had no knowledge of where my keystore was (in the jre directory!), so I hope this will help those who would like to see a usable syntax for that situation.

Solution 4 - Java

If you are on Mac or Linux, just go to the terminal and type in:

whereis jarsigner

It will give you the location of the jarsigner

Solution 5 - Java

If you can't find it, download and install Java JDK from here

Solution 6 - Java

In my case I try this:

sudo apt install openjdk-11-jdk-headless
sudo apt install openjdk-8-jdk-headless

I use openjdk

Solution 7 - Java

This error comes when you only have JRE installed instead of JDK in your JAVA_HOME variable. Unfortunately, you cannot have both of them installed in the same variable so you just need to overwrite the variable with new JDK installation path.

The process should be the same as the way you had JRE installed

Solution 8 - Java

For me the solution was in setting the global variable path to the JDK. See here: https://appopus.wordpress.com/2012/07/11/how-to-install-jdk-java-development-kit-and-jarsigner-on-windows/

Solution 9 - Java

This will install jdk for you and check for the jarsigner inside it

sudo apt install -y default-jdk

to find jarsigner you can use whereis jarsigner

Solution 10 - Java

Find in /usr/lib/jvm/java-8-oracle/bin/jarsigner -verbose -sigalg SHA1withRSA

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmimicocotopusView Question on Stackoverflow
Solution 1 - JavaMatt WolfeView Answer on Stackoverflow
Solution 2 - JavaFrancescoAzzolaView Answer on Stackoverflow
Solution 3 - JavastarmandeluxeView Answer on Stackoverflow
Solution 4 - Javauser3760100View Answer on Stackoverflow
Solution 5 - JavaAsaf PinhassiView Answer on Stackoverflow
Solution 6 - JavaDita Aji PratamaView Answer on Stackoverflow
Solution 7 - JavaBrian NyagolView Answer on Stackoverflow
Solution 8 - JavaMagor MenessyView Answer on Stackoverflow
Solution 9 - JavaJiyaView Answer on Stackoverflow
Solution 10 - JavagilcierwebView Answer on Stackoverflow