0

I am programming in java using Eclipse, I am a novice and I'm stuck with the following problem: I have an Eclipse project that uses an external jar library. In this library there is a specific class that needs to be temporarily modified. I have the source code for this class. Is it possible to somehow include the source file for the code into the project, so that it will "override" the corresponding class in the jar file?

Thank you.

Alina
  • 146
  • 8
  • 2
    you can open the jar with an archiver (e.g. winrar) and replace your .class with an updated one – wxyz Nov 09 '12 at 13:10

1 Answers1

0

Basically, it's not possible to have two classes with the same signature (package + name) in the classpath but it's possible to import this class in your project in different package and use it instead of the original one. Another way to solve this problem is to edit the .jar file by removing or changing the class that you need to be different. However, note that changing an API is almost never a good idea.

Emil Gotsev
  • 223
  • 2
  • 12