summaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-17 13:30:32 +0000
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-17 13:30:32 +0000
commit383bf9878a07b8fdc191b5adb4f00b7f458064af (patch)
tree818c76411f18f412436d6dd2392d945dc070c641 /libjava/gnu
parentb410bced60733856dd2ffc21842185ec626dc0da (diff)
downloadgcc-383bf9878a07b8fdc191b5adb4f00b7f458064af.tar.gz
Add extension directory contents to the class path.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83291 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/gcj/runtime/VMClassLoader.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java
index 3eabd73d431..75d193b103c 100644
--- a/libjava/gnu/gcj/runtime/VMClassLoader.java
+++ b/libjava/gnu/gcj/runtime/VMClassLoader.java
@@ -57,6 +57,36 @@ public final class VMClassLoader extends java.net.URLClassLoader
/* Ignore this path element */
}
}
+
+ // Add the contents of the extensions directories.
+ st = new StringTokenizer (System.getProperty ("java.ext.dirs"),
+ System.getProperty ("path.separator", ":"));
+ while (st.hasMoreElements ())
+ {
+ String dirname = st.nextToken ();
+ try
+ {
+ File dir = new File (dirname);
+ if (! dirname.endsWith (File.separator))
+ dirname = dirname + File.separator;
+ String files[]
+ = dir.list (new FilenameFilter ()
+ {
+ public boolean accept (File dir, String name)
+ {
+ return (name.endsWith (".jar")
+ || name.endsWith (".zip"));
+ }
+ });
+ for (int i = files.length - 1; i >= 0; i--)
+ addURL(new URL("file", "", -1, dirname + files[i]));
+ }
+ catch (Exception x)
+ {
+ // Just ignore any badness.
+ }
+ }
+
// Add core:/ to the end of the java.class.path so any resources
// compiled into this executable may be found.
try