0

This might sound stupid but is it possible to access classes with same name in 2 jars based on some condition.

My problem is i want to make a standalone java program where in i can connect to my old and new maximo systems through RMI

i am able to access both systems independently but for data migration i need to access both in same class. Biggest problem is both old and new jar files have same name

Is there any way i can refer to 1st jar in one method and second one in other method?

Thanks

checkgdata
  • 313
  • 5
  • 13
  • Could you post some details about your actual problem? The community might be able to come up with a different solution which is more maintainable than duplicate class names. – metacubed Jun 13 '14 at 01:18
  • A little more details – checkgdata Jun 13 '14 at 01:41
  • A little more details about problem: we are migrating from 5.2 maximo system to 7.5 both version have same class name psdi.util.MXSession in both systems Now i want to make connections to both systems in one class but how do i ensure old psdi.util.MXSession is called in method connecting to old system and new psdi.util.MXSession is called in method to connect to new system. I hope problem statement is clear Thanks – checkgdata Jun 13 '14 at 02:14
  • Below is the link that helped me for dynamic class loading http://java.dzone.com/articles/java-classloader-Handling – checkgdata Jun 23 '14 at 09:41

1 Answers1

0

You can use custom class loader. here is the link for details. just to quote your issue it says

... In fact, these applets can contain classes of the same name -- these classes are treated as distinct types by the Java Virtual Machine.

Rohit Sachan
  • 1,178
  • 1
  • 8
  • 16