i'm a newbie on linux, android and QA at the same time.

following this tutorial:
I came across to this situation:

filip@TowardMac:~/workspace_adt/TestSample$ ant build
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar 
Buildfile: /home/filip/workspace_adt/TestSample/build.xml

 [checkenv] Android SDK Tools Revision 22.3.0
 [checkenv] Installed at /home/filip/Development/adt-bundle/adt-bundle-linux-x86_64-20131030/sdk

[getbuildtools] Using latest Build Tools: 19.0.0
 [echo] Resolving Build Target for TestSample...
[getuitarget] Project Target:   Android 4.1.2
[getuitarget] API level:        16
 [echo] ----------
 [echo] Creating output directories if needed...
[mkdir] Created dir: /home/filip/workspace_adt/TestSample/bin/classes



Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-7-openjdk-amd64/jre"

Total time: 1 second

can anyone see the solution to this problem?

  • 1
    Did you look at the error? Is your JAVA environment configured properly? – Phil Kirkham Nov 19 '13 at 20:15
  • @peter: I didn't know that at the time. As I've said I was beginner at all posible fields. Thank you for your time. – MiniBug Mar 25 '14 at 8:54

It looks like you did not define Java. Please add JAVA_HOME to .bashrc

  • That seems to be the problem. Although, I add JAVA_HOME to '/etc/profile'. Which approach to the problem is better in your opinion? Thank you for your time. – MiniBug Mar 25 '14 at 8:58
  • What kind of shell do you use? Each shell has configuration file. Add JAVA_HOME to .bashrc if you use bash for your user and to .zsh, for example, if you use zsh. I prefer to add JAVA_HOME to .bashrc configuration file. But your decision is not bad too :) – amazpyel Mar 25 '14 at 9:56
  • I use bash. Can you tell me your point of view - why do you prefer it? I love my solution only coz it's working :-) – MiniBug Apr 4 '14 at 18:18
  • I use bash too but I have several workstation (home, office, etc.). So I can just put same .bashrc on each workstation. – amazpyel Apr 4 '14 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.