my dog learned polymorphism*
The moose likes Beginning Java and the fly likes jar versioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar versioning" Watch "jar versioning" New topic
Author

jar versioning

Vikram Gosain
Greenhorn

Joined: Jun 02, 2009
Posts: 25
Hello all,
I'm running into an issue with class names in different jars and
wonder if you could give me an idea.

I've two jars installed to "C:\Program Files\AppFolder\JarsFolder"
from my application installer.

First jar: Jar1.jar
Second jar: Jar2.jar

Both of them have same class names, along the lines
"com.company.dept.proj.component.classname", but they're jarred up
into two diff. jars.
I added these two jars in the CLASSPATH variable and my app is running
into a few issues, I'm not sure why, maybe its because of the
conflicting classnames.
The classes are in jars with different names, but it still seems to be
the problem.

Could anyone give me some pointers, please?


-Vikz
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37936
    
  22
That doesn't seem at all a good idea to have two different classes with the same fully-qualified name. Remember there is no guarantee which version is loaded first, so you can get different errors in different runs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jar versioning
 
Similar Threads
Simple to solve
some JAR problems.
Acess Denied Exception
Class not found error from deployed servlet
JVM: Could not find the main class. Program will exit