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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:49:23+00:00 2026-06-03T08:49:23+00:00

Consider a configuration class which needs to parse a different config file for each

  • 0

Consider a configuration class which needs to parse a different config file for each Eclipse project.

For instance, If Configuration class is called from Project1, it should parse special/path/fileX, and if it is being called from Project2, it should parse special/path/fileY.

I’ve tried using Eclipse’s {project_name}, but surprisingly it is being parsed to the project being highlighted by the cursor, not the parent project of the current class.

Any ideas how can I distinguish one project from another in Eclipse Runtime, preferably using JVM arguments?

  • 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-03T08:49:24+00:00Added an answer on June 3, 2026 at 8:49 am

    This is a workaround to your described problem, but I guess it’s a better solution as it’s independent from Eclipse and will easily work in production too.

    Simply load the same file from the classpath, regardless which Project you’re starting this from:

    /my/file/from/classpath.txt
    

    But put this file only in Project1 / Project2, such that the various files mutually exclude themselves according to your set-up:

    /Project1/src/my/file/from/classpath.txt
    /Project2/src/my/file/from/classpath.txt
    

    Where src are Java source folders. Now you can still use your JVM parameter to override this, or to provide a default if the above is missing.

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

Sidebar

Related Questions

Please consider the following piece of code, which throws three different exceptions (namely, System.Configuration.ConfigurationErrorsException
I have a configuration file that I consider to be my base configuration. I'd
Consider this scenario: I've an XML file called person.xml with the following data in
Consider this - a base class A, class B inheriting from A, class C
Is it possible that set a configuration that TFS 2010 sense file change from
Please, consider the following piece of a typical VMWare configuration file (*.vmx): memsize =
After creating settings for each dll , a .dll.config file is generated. If that
I have an application with a configuration file which has a lots of environment-specific
I have defined a custom section in the App.config file and all the Configuration
Consider the following hibernate configuration: <class name=Person> <id name=id column=personId> <generator class=native/> </id> <set

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.