java - Dynamic Jar loading is confusing me -


Conceptually, what am I doing to load a new jar? URLClassloader Is The Only Option? How do I make those URLs to point to a subdirectory with more jar?

If someone is feeling over-generous, then some display code will be helpful in performing the following tasks (let's say "jars / ezar" say "myClass" in which we want to instantiate):

  • Load some jars from a sub-directory
  • Return that to a particular class
  • Instant that class
  • Conceptually, what am I doing when I am loading a new jar

    You have a new jar Do not load Sector Instead, you are defining a class loader will load code and other resources from JR file on demand.

    Is URLClassloader the only option?

    In theory, you can implement your subclass of ClassLoader , but this is not necessary for what you are trying to do.

    How do I create URLs that point to more jar subdirectories.

    This is a small part of your problem which I think. The structure interprets the argument as url []

    "any URL referenced to a directory that ends with '/' The URL is considered to be mentioned as a jar file which will open when downloaded and opened. "

    In the first case of the quoted text above, the directory is considered To be the root of the tree with load resources

    but I I am trying to install a class loader that will load from all the JAR files in a given directory. To do this, you must:

    1. Create the directory of the file object for any JAR files and create a list.
    2. The array to keep the same number of URLs examples.
    3. For each JAR file file , use File.toURL () to create a URL and the array means that you will get the "File:" URLs for JAR files that will work on your platform.)
    4. Create URLClassLoader using URL array

    Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -