Hi,
I am trying to load a class dynamically.
Please look at the following code:
String strFileName="C:\\Connector.jar";
String strClassName ="com/connector/connector";
strCurrClassPath = System.getProperty("java.class.path",".");
strNewClassPath = strCurrClassPath + ";"+strFileName;
System.setProperty("java.class.path",strNewClassPath);
String strNew = System.getProperty("java.class.path",".");
System.out.println("strPrevious is"+strNew);
ClassLoader c= new ClassFinder();
Class some = c.loadClass(strClassName);
strClassName is the class name available in strFileName.
But when i execute this code it is still giving ClassNotFoundException.
Please let me know the reason ?
This is a bit urgent.