-classloaderProperties
command-line argument to the Eclipse executable. If the argument is used by itself
the default location (see below) is used for the classloader properties file.
Alternatively the argument can be followed by a path or URL to the appropriate
file to use.
boot.jar
in the org.eclipse.core.boot plug-in.
For instance:/eclipse/plugins/org.eclipse.core.boot/classloader.properties
If the user specifies the location of the file, it can be either a path or a URL to a file. For instance:
-classloaderProperties c:/temp/myfile.properties
-classloaderProperties file:/c:/temp/myfile.properties
java.util.Properties file. The key in the file is the name of the
plug-in and the value is a comma-separated list of the package prefixes for the packages in the plug-in's jar.
It is quite common for jar files to contain code which reside in multiple packages. For instance, the runtime.jar file
in the org.eclipse.core.runtime plug-in contains code in the following packages:
org.eclipse.core.runtime.
org.eclipse.core.internal.runtime,
org.eclipse.core.internal.plugins
org.eclipse.core.runtime.model
In this case, in the classloader properties file we put specify the following line:
org.eclipse.core.runtime=org.eclipse.core
Notice that org.eclipse.core is a common prefix for all packages
in the runtime.jar. The alternative is to declare all 4 prefixes
in the file as a comma-separated list. In this case one must weigh the trade-off
between the number of checks required against multiple entries and a prefix
which may include false hits. Depending on the way that your code is structured,
it might be best to list as many as 5-10 package prefixes rather than going
with a more general prefix. For instance, if all your code across multiple plug-ins
contains the same prefix (e.g. com.mycompany) then you will not
be taking full advantage of all benefits if you list only the single prefix
"com.mycompany" in the file.
It is also common for plug-ins to contain multiple jar files with code. In this case all package prefixes from all jars should appear in the classloader properties file.
Note that not having an entry for your plug-in as a key in the file doesn't mean that your code will not work, it just means that you will not be able to take advantage of classloading optimization. And note that missing a package prefix as a value entry in the file does mean that your code will not work.
See the file which is shipped with Eclipse for an example.
(/eclipse/plugins/org.eclipse.core.boot/classloader.properties)
plugin.xml
file to take advantage of this classloading performance behaviour to make it easier
for people who are extending the Eclipse platform.
java.lang.ClassNotFoundException then that is an indication that there might be a problem
with your entries in the properties file. The file could have the correct syntax, but the package prefixes in the
comma-separated list might be missing some entries. The workaround for this is to comment out the line of the offending plug-in.