Create a new, custom class loader...
URLClassLoader cl = new URLClassLoader(
new URL[]{new File("Path/to/Project/mal.jar").toURI().toURL()}
);
Load the class from the class loader...
Class clazz = cl.loadClass("Mal.MalClass");
Create a new instance of the class...
Object obj = clazz.newInstance();
Now. You have a problem. Unless the Class
you've just loaded implements a interface
which is common to both projects, you won't be able to resolve the instance of the Class
to an actual type, as the type would be unknown at compile time. Instead, you would be forced to use reflection, which is never pretty...