Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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

following this tutorial:
http://developer.android.com/tools/testing/testing_ui.html#sample
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

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

-build-setup:
[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

-pre-compile:

compile:

BUILD FAILED
/home/filip/Development/adt-bundle/adt-bundle-linux-x86_6420131030/sdk/tools/ant/uibuild.xml:183: 
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
filip@TowardMac:~/workspace_adt/TestSample$   

can anyone see the solution to this problem?

share|improve this question
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 at 8:54

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
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 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 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 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 at 19:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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