Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:47:36+00:00 2026-06-17T18:47:36+00:00

I have a main android app which has 2 jars in it’s libs folder.

  • 0

I have a main android app which has 2 jars in it’s libs folder. This android app includes a Java Source Project which has about 4 jars in it’s libs folder.

In the build.xml I have copied from android’s build.xml the ‘target name=”-compile”>’.

and added this:

    <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping..." >

        <!-- merge the project's own classpath and the tested project's classpath -->

        <path id="project.javac.classpath" >

            <path refid="project.all.jars.path" />

            <path refid="tested.project.classpath" />
        </path>
 <javac
  bootclasspathref="project.target.class.path"
  classpathref="project.javac.classpath"
  debug="true"
  destdir="${out.classes.absolute.dir}"
  encoding="${java.encoding}"
  extdirs=""
  fork="${need.javac.fork}"
  includeantruntime="false"
  source="${java.source}"
  target="${java.target}"
  verbose="${verbose}" >
  <src path="${source.absolute.dir}" />
  <src path="${gen.absolute.dir}" />
  <src path="${javaproject.dir}" /> #THIS IS WHAT I ADDED which is defined in ANT.PROPERTIES
  <compilerarg line="${java.compilerargs}" />
</javac>

So it references the java source project. The problem happens with the java source project’s jars which are in folder libs.
How do I also include them?

ps. copying them to android project’s libs folder is not an option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:47:37+00:00Added an answer on June 17, 2026 at 6:47 pm

    You have the following:

    <javac
         bootclasspathref="project.target.class.path"
         classpathref="project.javac.classpath"
         debug="true"
         destdir="${out.classes.absolute.dir}"
         encoding="${java.encoding}"
         extdirs=""
         fork="${need.javac.fork}"
         includeantruntime="false"
         target="${java.target}"
         verbose="${verbose}"
    
         source="${java.source}">
    
         <src path="${source.absolute.dir}" />
         <src path="${gen.absolute.dir}" />
         <src path="${javaproject.dir}" /> #THIS IS WHAT I ADDED which is defined in ANT.PROPERTIES
    
        <compilerarg line="${java.compilerargs}" />
    </javac>
    

    Notice you’ve specified both the source parameter and the <src path> sub-entity. Also notice that you have a reference to javaproject.dir. What is this directory? Is it the source of the other project, the other project’s main directory, or something else?

    First, you shouldn’t use both <src path> and the srcdir parameters in your <javac> command. If you need only a single source directory path, you can use either the srcdir parameter of the <javac> task, or the <src path> sub-entity. If you have more than one, you should not use srcdir, and only use the <src path> sub-entity.

    Now back to your question…

    If I understand you correctly, you want to specify multiple classpath folders in your <javac> task. You can do this by removing the classpath or classpathref parameters of the <javac> command, and simply specify multiple <classpath path> sub-entities like you do with source directories.

    I think you want something like this:

    <javac
         bootclasspathref="project.target.class.path"
         debug="true"
         destdir="${out.classes.absolute.dir}"
         encoding="${java.encoding}"
         extdirs=""
         fork="${need.javac.fork}"
         includeantruntime="false"
         target="${java.target}"
         verbose="${verbose}">
    
         <!-- Here I can specify multiple classpaths: -->
         <!-- Either classpath references, or classpath elements -->
         <classpath refid="project.javac.classpath"/>
         <classpath refid="some.other.classpath.reference"/>
         <classpath path="${some.actual.directory.with.jars}"/>
    
         <src path="${java.source}">
         <src path="${source.absolute.dir}" />
         <src path="${gen.absolute.dir}" />
         <!-- <src path="${javaproject.dir}" />  Is this correct? -->
    
         <compilerarg line="${java.compilerargs}" />
    </javac>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have build an android application which has a main menu. In the main
Good day. I have an app that has one main activity which holds 3
I have a android app, in which the main activity calls a function from
I am writing an Android app. I have an activity in my main project
My Android app has a main WebView (HTML loaded from a local resource) which
I have a simple android app to play videos. I have a main screen
I am making an android app. I have a main activity and i want
I have an android app where in my Main activity I can play music
I have an Android app with a ListActivity in the main view. The list
I have a GridView like this( main.xml ): <?xml version=1.0 encoding=utf-8?> <GridView xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/gridView1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.