0

I want to place ABC.properties file in a directory in the classpath ahead of cmbview81.jar .

cmbview81.jar already has ABC.properties file in it. I extracted the file made some changes and made new ABC.properties file and now want to set its path ahead of cmbview81.jar file so that application will not point to the file which is in cmbview81.jar file.It should use new ABC.properties file.

I tried solutions provided here How to place a file on classpath in eclipse? but didn't work.

Community
  • 1
  • 1
happy
  • 2,550
  • 17
  • 64
  • 109
  • Most of the time jars are loaded using lexicographical order. If you cannot change cmbview81.jar for good reasons, you could try to put the *ABC.properties* file in a jar called `a.jar` (or anything prior cmbview81). This way it should be loaded first. – Olivier.Roger Jul 18 '12 at 07:23
  • I'm not so sure about the above comment, I think jars are loaded in the order they appear on the classpath. If you are doing something that automatically constructs the classpath from a directory, this will of course result in them being loaded in lexicographical order. – Francis Upton IV Jul 18 '12 at 07:42

1 Answers1

1

Put it in a separate Jar file and see to it that this Jar file is included in front of the existing Jar file in the classpath specification. The order of specification of the Jar files in the classpath is significant (it's the same idea as directly using the CLASSPATH variable).

You could also put it in your src somewhere, but just make sure then that your src folder occurs before the Jar files in the Order and Export tab of the Eclipse Java build path configuration.

Francis Upton IV
  • 19,322
  • 3
  • 53
  • 57