Questions tagged [urlclassloader]

This class loader is used to load classes and resources from a search path of URLs referring to both JAR files and directories.

286 questions
0
votes
0 answers

How to load .class files from an .jar that are in an package

I need to load the Client.class using an ClassLoader . When I use this code: ClassLoader clientClassLoader = new URLClassLoader( new URL[] { new File("client.jar").toURL() }); Class clientClass =…
Piet Jetse
  • 388
  • 1
  • 5
  • 16
0
votes
0 answers

URLClassLoader in eclipse plugin

I am implementing a plugin for content assist in xml. In the implementation I am loading the classes of a project as, URLClassLoader classLoader = new URLClassLoader(urls,Thread.currentThread().getContextClassLoader()); But when i make changes in…
Hareesh
  • 694
  • 6
  • 18
0
votes
0 answers

C Linux - How to load code from URL

Is there any way to load code/libary directly into RAM from the network in c on linux. It is possible in java using URLClassLoader but is there any way to implement the same functionality in c. So far i have found dlopen function in c to load so…
Somil
  • 481
  • 3
  • 8
0
votes
0 answers

ClassCastException in plugin loader

I am currently experiencing another strange problem with Java. My goal was to make a small plugin system to provide an API for one of my applications. I managed to do such a thing and it works pretty good in Windows. But when I try to run the same…
Niklas S.
  • 1,046
  • 10
  • 22
0
votes
1 answer

How to reload a class using Java UrlClassLoader

I have a list of classes which I need to use many times during the execution of my program, I need to load them dinamically because their code can change very often and I want to treat them as services so that I can update them easily. Here my…
Hira
  • 3
  • 2
0
votes
0 answers

classpath option vs URLClassLoader or Spring nightmare

I have code(it's wrapper for another applicaton): URLClassLoader classLoader = new URLClassLoader(urls); Class mainClass = classLoader.loadClass("org.ololo.DummyClass"); Method main = mainClass.getMethod("main", new Class[]{ …
kain64b
  • 2,258
  • 2
  • 15
  • 27
0
votes
1 answer

Android Class Loader Error

I want to instance the ScreenX class in my jar file and try all of the solition on this site but it can not run. I have two file that; File folder = getDir("JarFile", MODE_PRIVATE); //and File file = new File(folder, "plugin.jar"); I tried…
0
votes
2 answers

Save class to file from URLClassLoader? and decompile it?

It's possible to save class from URLClassLoader to normal file.class? and then decompile it? I trying save it just as object using Class clazz = classLoader.loadClass("foo.Bar"); FileOutputStream sf = new FileOutputStream(f); …
user2250333
  • 133
  • 3
  • 17
0
votes
1 answer

How to load methods from a jar without loading class?

I am trying to read a Jar file which contains few classes and has methods defined in it. I want to get all the declared methods from all the classes without loading individual classes. is it possible? Here's how I am loading jar file and…
Yunkhan
  • 53
  • 3
  • 10
0
votes
2 answers

understanding urlclassloader, how to access a loaded jar's classes

I am trying to understand how to access/make available a jar file using URLClassLoader. Firstly I am loading the jar file with package myA; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import…
art vanderlay
  • 2,341
  • 4
  • 35
  • 64
0
votes
1 answer

programmatically compiling and loading java source files in clojure

I've run into some problems following this question on SO: How do I programmatically compile and instantiate a Java class? The following is my clojure translation: (ns compile-and-load.core (:import [javax.tools JavaCompiler ToolProvider] …
zcaudate
  • 13,998
  • 7
  • 64
  • 124
0
votes
1 answer

java.net.URLClassLoader doesn't add class annotations

While developing a ant - task to autogenerate some gui - code for a project using annotations as I prefer a declarative approach I am using the java.net.URLClassLoader to dynamically add the classes to my class path. When scanning the classes for…
Peter
  • 1,769
  • 1
  • 14
  • 18
0
votes
0 answers

Class loading from a non-default Package

When I try to load a class Dynamically at run-time, and that class was compiled in a package that is not the default package, I have a ClassNotFound Exception. Example: Package name: "Model". Class name: "Cup.class". This is my code: File file = new…
0
votes
0 answers

akka scala: URLClassLoader causes actors to not fail isAssignableFrom

I am trying to dynamically load an actor from an external jar and then launch that actor into the ActorSystem. I want a plug-in style architecture for loading actors. So far I am tried the following code: val loader = new URLClassLoader(Array(new…
Ben Schmidt
  • 261
  • 2
  • 13
0
votes
1 answer

Why URLClassLoader does not load class?

I have downloaded the aspectJ.jar file and extracted it into a temp directory (this jar file is used for test purposes only). I have the following code: public class TestUrlClassLoader { public static void main(String [] args) throws…
Cherry
  • 31,309
  • 66
  • 224
  • 364