Index: src/org/openstreetmap/josm/Main.java
===================================================================
--- src/org/openstreetmap/josm/Main.java	(revision 249)
+++ src/org/openstreetmap/josm/Main.java	(revision 250)
@@ -12,4 +12,7 @@
 import java.net.URISyntaxException;
 import java.util.Arrays;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -208,5 +211,4 @@
 		if (plugins.isEmpty())
 			return;
-
 		SortedMap<Integer, Collection<PluginInformation>> p = new TreeMap<Integer, Collection<PluginInformation>>();
 		for (String pluginName : plugins) {
@@ -225,7 +227,22 @@
 			}
 		}
+		
+		// iterate all plugins and collect all libraries of all plugins:
+		List<URL> allPluginLibraries = new ArrayList<URL>();
+		for (Collection<PluginInformation> c : p.values()) {
+			for (PluginInformation info : c) {
+				allPluginLibraries.addAll(info.getLibraries());
+			}
+		}
+		// create a classloader for all plugins:
+		URL[] jarUrls = new URL[allPluginLibraries.size()];
+		jarUrls = allPluginLibraries.toArray(jarUrls);
+		URLClassLoader pluginClassLoader = new URLClassLoader(jarUrls, Main.class.getClassLoader());
+		
+		
 		for (Collection<PluginInformation> c : p.values()) {
 			for (PluginInformation info : c) {
 				try {
+					info.setClassLoader(pluginClassLoader); // set the common classloader
 					Class<?> klass = info.loadClass();
 					ImageProvider.sources.add(0, klass);
Index: src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 249)
+++ src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 250)
@@ -33,5 +33,6 @@
 	public final String author;
 	public final int stage;
-	public final List<URL> libraries = new ArrayList<URL>();
+	protected final List<URL> libraries = new ArrayList<URL>();
+	protected ClassLoader classLoader;
 
 	public final Map<String, String> attr = new TreeMap<String, String>();
@@ -68,5 +69,5 @@
 			if (file != null)
 				libraries.add(new URL(getURLString(file.getAbsolutePath())));
-			String classPath = attr.getValue("Class-Path");
+			String classPath = attr.getValue(Attributes.Name.CLASS_PATH);
 			if (classPath != null) {
 				String[] cp = classPath.split(" ");
@@ -112,8 +113,5 @@
 	public Class<?> loadClass() {
 		try {
-			URL[] urls = new URL[libraries.size()];
-			urls = libraries.toArray(urls);
-			ClassLoader loader = URLClassLoader.newInstance(urls, getClass().getClassLoader());
-			Class<?> realClass = Class.forName(className, true, loader);
+			Class<?> realClass = Class.forName(className, true, getClassLoader());
 			return realClass;
 		} catch (Exception e) {
@@ -127,4 +125,33 @@
 		return "file://"+fileName;
 	}
+
+	/**
+	 * Returns all libraries the plugin needs (the plugin's jar file itself and all jars declared
+	 * in the manifest's Class-Path section).
+	 * @return the libraries a list of URLs to the libraries.
+	 */
+	public List<URL> getLibraries() {
+		return libraries;
+	}
+
+	/**
+     * @return the classLoader
+     */
+    public ClassLoader getClassLoader() {
+		// if I have no classloader set, create one for me and my libraries:
+		if(classLoader == null) {
+			URL[] urls = new URL[libraries.size()];
+			urls = libraries.toArray(urls);
+			classLoader = URLClassLoader.newInstance(urls, getClass().getClassLoader());
+		}
+    	return classLoader;
+    }
+
+	/**
+     * @param classLoader the classLoader to set
+     */
+    public void setClassLoader(ClassLoader classLoader) {
+    	this.classLoader = classLoader;
+    }
 	
 	/**
@@ -190,2 +217,3 @@
     }
 }
+
