Users Pricing

forum

Home Forums How should we set classpath URL's to URLClassLoader? – MindStick

How should we set classpath URL's to URLClassLoader?

Anonymous User 1595 03 Dec 2015
I have this piece of code:

URLClassLoader tmp = new URLClassLoader(new URL[] { getClassPath() });
private static URL getClassPath() {
    return new URL("/home/rudik/workspace/cl/target/classes/");
}
I got /home/rudik/workspace/cl/target/classes/ from Arrays.toString(((URLClassLoader) MyClass.class.getClassLoader()).getURLs()) execution.

When I execute it I get this exception:

java.net.MalformedURLException: no protocol: /home/rudik/workspace/cl/target/classes/

1 Answers

Anonymous User 03 Dec 2015 Accepted Answer
Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md