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

10,081

Solution 1

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

Solution 2

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
Share:
10,081
Admin
Author by

Admin

Updated on June 23, 2022

Comments

  • Admin
    Admin about 2 years

    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.

  • Alexander Tyapkov
    Alexander Tyapkov over 7 years
    consider using comments to ask more info about the question.