| Anonymous | Chin,
I've discussed this with our engineers here and thre is a way you can do this without having to change the location of the JAR or class files. Basically, you use a URL classloader to add to the current classloader and load the class that way. Basically you do the following:
1) Create a new URL object that points to the directory in which the classes you wish to load reside. You will know the name of the application, so you can put together the URL. Since you are loading a file and not accessing a URL, use the "file" protocol contructors. You can make the URL point to the java/classes directory and make another pointing to the java/lib directory or individual JAR files within it. Now, you can additionally refer to the AUDIUM_HOME environment variable to determine the path so you don't have the path hardcoded.
2) Create a new URLClassLoader object with the URLs you created.
3) Use the loadClass method of URLClassLoader to load the class.
This process is very much like the process we use in our classloaders.
Hope this helps! |
| Please sign in to flag this as inappropriate. |