<< Windows, Java, Linux, ... | Home | BeanShell >>

Duplicate Classes In CLASSPATH

Here's a hypothetical question :): Should the same Java class be allowed to appear twice in the CLASSPATH of one application (in two different jar files)?



Re: Duplicate Classes In CLASSPATH

absolutely. its a commonly used technique when overriding a class that is part of a library. include your custom jar with the class before the library jar in the classpath.

Re: Duplicate Classes In CLASSPATH

Unless one of the JARs is sealed or signed, in which case you run into problems...

Re: Duplicate Classes In CLASSPATH

What about the same resource, such as log4j.xml?

Re: Duplicate Classes In CLASSPATH

Hmmm....good question. We'll have to try it out.

Add a comment Send a TrackBack