It is possible to have 2 jars with the same name of class. Does it possible control which class will be loaded(used) by JVM ?
Thanks.
It is possible to have 2 jars with the same name of class. Does
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have two jar with the same class, which one will be loaded depends on the order of the jars. You can also create your own class loader, and chain it to the parent class loader. Therefore your class loader will try to load the class, and if it fails, it will fall back to parent. Take a look at this one for example: http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLClassLoader.html