0

I am trying to do the release process of an android app, but am confused about the keytool and jarsigner.

The official doc says :

If you are developing on a version of Linux that originally came with GNU Compiler for Java, make sure that the system is using the JDK version of Keytool, rather than the gcj version. If Keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. In this case, check the symlink target to be sure it points to the Keytool in the JDK.

  1. I am working on an Ubuntu 14.04, with environment variable JAVA_HOME = /home/faizal/DEV/jre1.7.0_55. There is a keytool inside it's bin subfolder. How do i know if this is the JDK or gcj version? I can't really remember where i downloaded the JRE from.

  2. Keytool is already in my path because i had added $JAVA_HOME/bin. I could not find any symlink with the name Keytool in /usr/bin using the command ls -lR | grep keytool. But i don't think i have a JDK on my system. Do i need to get it?

  3. I could not find jarsigner in $JAVA_HOME. Where can i get it from?

faizal
  • 3,497
  • 7
  • 37
  • 62
  • The easiest way would be (if you are using eclipse) to use the wizard. See here: http://stackoverflow.com/questions/3417122/how-to-use-eclipse-to-create-released-signed-apk – HectorLector Jul 11 '14 at 21:01

1 Answers1

0

If you are building APKs then you must be having a JDK.

ls -l `which javac`
will tell you where the JDK is installed.

About jarsigner I see a symlink for it in /usr/bin. If not there you will find it in the bin directory of your JDK. If you are building your apk successfully already the $JAVA_HOME is where your JDK is.

brahmana
  • 1,286
  • 12
  • 24
  • `jarsigner` is not present in my system. I think the reason is that i don't have a JDK. I have been building my apk successfully in Eclipse Luna, but $JAVA_HOME is only a `JRE`. I am thoroughly confused. – faizal Jul 12 '14 at 05:11
  • Check your Eclipse settings to see where it is picking the compiler (javac) from. There should be a java compiler if apk is being built. This page http://developer.android.com/sdk/index.html makes it amply clear that only JRE is not sufficient, JDK is required. Btw, aren't you using the ADT Eclipse bundle? If yes, doesn't it have GUI options to sign the APK generated? If Eclipse is managing your JDK then I think it will know where to find jarsigner. Note, I am not an Eclipse user. I do it from the command line. – brahmana Jul 12 '14 at 17:48
  • I just couldn't figure out where Eclipse was getting the `javac` from. So i ended up downloading the JDK, which had `jarsigner` in the bin folder. Yes ADT has the GUI option for exporting and that worked perfectly. But i was hoping to try the command line..and so the question. thanks. – faizal Jul 12 '14 at 18:00