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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:41:11+00:00 2026-06-06T21:41:11+00:00

So I have say two projects, project A and project B. Project A contains

  • 0

So I have say two projects, project A and project B. Project A contains a main class which I want to run. Project B contains some classpath resources which are required and also has a reference to Project A. If I run the main class in Project A directly, it will only run it in the context of that project and won’t include the classpath resources as they’re in Project B.

But if I try to run Project B, I can’t select the main class (as it doesn’t exist in that project) and if I try right-clicking the project -> Run As -> Java Application, it doesn’t come up with that main class as a valid main class. (It does come up in the similar dialog for Project A.)

This seems to be a common problem from Eclipse; I found this related question but this person is not using Maven. Also, they accepted an answer which referenced project B from project A, which breaks the encapsulation I am trying to achieve here:
Eclipse 3,6 (Helios) referenced project has main method, cannot access from run config when targeting referencing project

  • 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-06T21:41:13+00:00Added an answer on June 6, 2026 at 9:41 pm

    Options I can think of:

    1. Use the command line to kick off the main method passing the jar in the classpath.
    2. Have project A refer to project B’s config rather than the other way. [I realize you don’t want to do this, but feel compelled to list it to be thorough)
    3. Create a class in project B that has a main method which delegates to project A.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have two types of MongoDB documents: 'Projects' and 'Tasks'. A Project
I have two projects, my main android application and another test project that runs
I have two projects namely A and B. Project A has a class C
Let's say I have two simple models project t.string :title vote t.references :project t.integer
Ok so here is a question. I have two projects in code igniter, say
Let's say I have two maven profiles for running projects web tests: 1. first
Possible stupid question: let's say I have two apps contained within one project. Can
I have two columns say Main and Sub . (they can be of same
I have two entities say Customer and Order which exist on their own and
We have a project here which is split into two. One for Internal and

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.