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 7778623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:26:40+00:00 2026-06-01T18:26:40+00:00

I am trying to use org.apache.commons.collections.CollectionUtils in Android. The sample is below import java.util.ArrayList;

  • 0

I am trying to use org.apache.commons.collections.CollectionUtils in Android. The sample is below

import java.util.ArrayList;

import org.apache.commons.collections.CollectionUtils;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class CheckCommonsActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    String email1 = "xyz@gmail.com";
    String email2 = "abc@gmail.com";
    String email3 = "mnp@gmail.com";
    String email4 = null;       

    ArrayList<String> emailList1 = new ArrayList<String>();
    emailList1.add(email4);
    emailList1.add(email1);
    emailList1.add(email2);
    emailList1.add(email3);

    ArrayList<String> emailList2 = new ArrayList<String>();
    emailList2.add(email3);
    emailList2.add(email2);
    emailList2.add(email1);

    boolean isEqual = CollectionUtils.isEqualCollection(emailList1,
 emailList2);
    TextView text = (TextView) findViewById(R.id.text);
    text.setText(String.valueOf(isEqual));
   }
 }

I have imported commons-collections-3.2.1.jar to Build Path of Android Project, but I am getting error java.lang.NoClassDefFoundError: org.apache.commons.collections.CollectionUtils at runtime.

Edit1

Android Project Artifact

Thanks

  • 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-01T18:26:41+00:00Added an answer on June 1, 2026 at 6:26 pm

    You have to put the library in /libs (not /lib) folder of your android project

    Edit: I was assuming that you put it in /lib folder because this is a common failure. In your added screenshot can be seen that you included the lib as external jar. Anyway..whether you put it in /lib or as external jar the solution is the same: create /libs folder and put the lib there

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use org.apache.commons.collections.CollectionUtils in android with following code import java.util.ArrayList; import
I'm trying to use the StringEscapeUtils.escapeXML() function from org.apache.commons.lang... There are two versions of
I am trying to use the import of org.apache. However when I put it
I am trying to import: import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.apache.commons.httpclient.params.HttpMethodParams; But I am
I am trying use a Java Uploader in a ROR app (for its ease
I'm trying to use embedded ActiveMQ broker for unit testing, as explained here: http://activemq.apache.org/how-to-unit-test-jms-code.html
I'm trying to use the org.apache.ddlutils package for reading database metadata. I've written the
I'm trying to use the Base 64 functions present in the Apache Commons Codec
I am trying to use Apache Commons Math's SpearmansCorrelation but I am having some
I am trying to use commons-logging with log4j to write my app logs to

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.