1
votes

I have a Android Project which is running fine on command line as well as using eclipse. So now I created the test project for the same, currently it is dependant on one external JAR. I kept this jar in libs/ directory. I can build and run the test project from command line.

Now the problem is that Eclipse is not able to recognize the JAR placed in libs directory and so eclipse is not able to build the project. I tried to modify build.properties file (setting the libs path in it), but that does not helped me.I don't want use properties ->JAVA build path -> Libraries -> Add external JARS in eclipse

Can some one tell the exact steps to build the test project with command line as well as with eclipse . Also, can I keep the JARs on another location than project directory ?

I don't want to use Maven

1
check this link and build............. stackoverflow.com/questions/2472059/…diyesh
Thanks diyesh for quick reply. I saw that link previously also. But that does not solved my problem. I can build my project smoothly on terminal but eclipse gives me error. It is not able to find the Robotium jarSachchidanand

1 Answers

0
votes

I encounter a similar problem with the following configuration:

MainProject
-src
 -...
-libs
  -ok.jar

TestProject
-src
 -testFiles

The ok.jar file is both needed by the MainProject and the TestProject

If I add the jar into TestProject/libs/ok.jar the build fail cause of class duplication. If I reference the MainProject/libs/ok.jar file threw external jar into the properties of the TestProject it does not work either.

I finally modified the properties of the MainProject to make it export the ok.jar file to other project by checking the combobox:

Project Properties -> Java Build Path -> Order and Export -> check the ok.jar file.

Last, the TestProject reference the MainProject as "Required projects on the build path".

Now the test project can see and use the ok.jar file.

It works fine threw eclipse and ant.