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
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.
精彩评论