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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:06:10+00:00 2026-06-11T13:06:10+00:00

If I have 2 java projects in my RAD. Project #1 has a class

  • 0

If I have 2 java projects in my RAD. Project #1 has a class like this:

/src/com/orgname/model/Model1.java

In Project #2, I also have:

/src/com/orgname/model/Model1.java

Both these classes compile fine. Now in Project #2, I add Project #1 as a build path dependency. Now in my project #2, I write a test class where I do : import com.orgname.model.Model1

Which Model1 will be imported?

  • 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-11T13:06:11+00:00Added an answer on June 11, 2026 at 1:06 pm

    Having duplicate copies of classes is a terrible idea! It may compile just fine, and it may even run fine 9 times out of 10, but there is no (simple) way to ensure that one gets loaded over the other at runtime!

    In fact, a very common occurrence when duplicates like this exist (whether it be .class files or .jars) is that in some instances version 1 gets loaded, and other times version 2. When this happens and the wrong class is returned, you will get a ClassNotFound or similar Exception. This can be very frustrating to debug, since your code may not fail reliably.

    When this happens with artifacts it is referred to as JAR Hell, but the principle is the same: any time you have two copies of a class with the same package and name, you are asking for trouble.

    Instead, change the name of Model1 in one of your projects or use different packaging to differentiate the two.

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

Sidebar

Related Questions

I have some experience writing web applications in Java for class projects. My first
With RAD Version: 7.5.3, Java 1.5. I have a couple of different projects. I
I have multiple Java projects in Eclipse. I would like to reuse some classes
I have a basic EJB 3.0 (Java EE 5) project in IBM RAD (aka
I have java project that depends from other java projects. These projects are maven
I have two Java Projects. One is a normal Java Project. I want to
I have 2 different Java projects, one has 2 classes: dynamicbeans.DynamicBean2 and dynamic.Validator .
I have a Java Project, where i would like to use Android LogCat's debug-tagging
I have two Eclipse Maven Java projects. A domain project that is laden with
i often have in java projects a lot of small helper(storage) classes like 2-Tuple,

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.