user2381331
user2381331

Reputation: 31

executing jarsigner command generates error: "Jarsigner is not recognized internal or external command"

I am trying to verify signature of apk uploaded on my site. I am trying to execute

String command= "cmd /c jarsigner -verify -verbose -certs " +Filelocation;
Process proc = Runtime.getRuntime().exec(command);
BufferedReader reader=new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader reader1=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String line=reader.readLine();  
String line1=reader1.readLine();

line output is null and line1 output is"Jarsigner is not recognized internal external command".

I have checked java_home,java.home,java.class.path. java_home is holding jdk path java.home is holding jre path java.class.path holds jboss server>deploy folder.

I am running this part of code on JBOSS Server.

Upvotes: 3

Views: 10671

Answers (3)

marika.daboja
marika.daboja

Reputation: 991

1 Make sure below Environment Variables are set:

Variable name: JAVA_HOME Varaible value: C:\Program Files\Java\jre7 (example only; update path based on your Java library location)

Variable name: Path Varaible value: %JAVA_HOME%\bin;

2 Make sure that jarsigner.exe file exists in your JAVA library ie.

C:\Program Files\Java\jre7\bin\jarsigner.exe

Upvotes: 0

Umar Pharouk
Umar Pharouk

Reputation: 1

Make sure the release key and the apk are in the same directory.

Upvotes: 0

stuckedunderflow
stuckedunderflow

Reputation: 3767

Make sure Java JDK is set on the PATH. In my case put "D:\Java\jdk1.6.0_34\bin" into System Variable PATH.

Upvotes: 8

Related Questions