This class loader is used to load classes and resources from a search path of URLs referring to both JAR files and directories.
Questions tagged [urlclassloader]
286 questions
1
vote
3 answers
How to load all classes of a jar file at runtime?
According to this question, it is possible to load a class from a jar file with:
ClassLoader loader = URLClassLoader.newInstance(
new URL[] { jarFileURL },
getClass().getClassLoader()
);
Class> clazz = Class.forName("mypackage.MyClass",…

julien
- 898
- 3
- 17
- 32
1
vote
0 answers
Getting NoClassDefFoundError even tho the system can see the class ist is meant to load
The code block below is inside a function that accesses a jar file. I have already checked to see if the path to the file is correct. When printing the classnames from the jar file to the console, i see all the correct classnames. …

pbuort
- 11
- 1
1
vote
1 answer
How to use URLClassloader in an auto-update jar launcher?
I've come across many posts about these two topics: Auto-Updating and URLClassloaders. I'll start with the auto updating goal. I found this post here that talks about a 2 jar system. One jar that launches the main app jar: From Stephen C:
The…

Kyle
- 89
- 9
1
vote
1 answer
How to use custom classloader for subsequent class loadings?
I have a main method that creates custom classloader and instantiates a class, called Test, with it.
public class App {
public static void main(String[] args) throws Exception {
try {
…

Runekn
- 85
- 5
1
vote
2 answers
Compiling classes with Toolprovider and loading them with ClassLoader
I'm trying to load classes that I generate an compile in runtime. I can compile them without no problem with this code:
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager fileManager =…

yokese
- 13
- 4
1
vote
1 answer
Load SPI class with URLClassLoader rise ClassNotFoundException
I did some research, But due to complexity of this situation, Not working for me.
Child first class loader and Service Provider Interface (SPI)
Like flink or tomcat, My application run as framework with platform and system classloader.
Framework…

Alceatraz
- 432
- 1
- 3
- 13
1
vote
3 answers
Getting variables and methods of class from loaded class.
My scenario:
A class is going to be loaded from a number of different classes using ClassLoader.
How do I get the methods and variables from the class that loads another class - from the other class? I.e. getting methods and variables from a class I…

Mike Haye
- 793
- 3
- 12
- 22
1
vote
1 answer
Apache Ignite: enabling Peer Class loading did not auto deploy StoreAdapter and Pojo classes
I am using Apache Ignite 2.10.0, i want read/write through feature to load/write data into cache from and to the third party persistence, in order to do it i implemented PersonStore which extends CacheStoreAdapter class. I want my…

arun
- 11
- 2
1
vote
1 answer
NoClassDefFoundError - Loading subclass via URLClassLoader inside a SpigotMC Plugin
I am trying to build a microservice system in Java. For the services themselves, I created a class Service which all Services extend. An example service would look like this:
package me.test;
public class TestService extends Service {
public…

DeveloperTK
- 112
- 2
- 9
1
vote
1 answer
How to load the bean XML file from another jar using ClassLoader
I need to load the bean XML files which is located inside another Jar file using ClassLoader.
Can anyone help me here.

Raigon Augustin
- 51
- 3
1
vote
1 answer
Java URLClassLoader works in eclipse but not in cmd
I have a program that tries to load java classes from a folder, using URLClassLoader. The classloader is able to load the classes while running in eclipse, but when I try to run it in cmd it throws ClassNotFoundException.
File…

Johnny Liang
- 11
- 2
1
vote
1 answer
BuiltinClassLoader cannot be resolved to a type
Using Eclipse 2020-03 version.
After adding "ojdbc-12.1.0.2.0.jar" as class path for one of project which has dependency with ORACLe encountered below error during build.
BuiltinClassLoader cannot be resolved to a type.
This class has been used in…
1
vote
0 answers
How to register a resource to a class loader in runtime?
I found similar questions on how to add a file or a class, but in this case
the resource to be registered is going to be constructed at runtime and kept in memory.
So to illustrate this, say I want to create configuration properties for some library…

igobivo
- 433
- 1
- 4
- 17
1
vote
0 answers
How Java class loader optimize the duplicate class loading?
I have a method where one of the class is getting loaded by passing the current class name.
This method is called from multiple places and multiple times.How many instances of the class is loaded into JVM. Does this impact the application…

JavaUser
- 25,542
- 46
- 113
- 139
1
vote
0 answers
Manifest.mf and imports
I have the following dynamodb.jar structure, where lib/ has a bunch of .jars. All these nested .jars are needed by com.mparnisa.dynamodb.table.
From another IntelliJ project I am trying to instantiate a class within this dynamodb.jar:
try {
…

Maria Ines Parnisari
- 16,584
- 9
- 85
- 130