Paul Kinnucan wrote:
> 
> At 02:26 PM 8/9/99 -0400, Peter Brown wrote:
        [snip]
> 
> Hi Peter,
> 
> Try including the Java3D.jar file explicitly on your classpath. If I recall
> correctly, you can't assume that the BeanShell knows about JKK 1.2.2's
> default classpaths. I think some time ago I had to get the BeanShell's
> author to update the BeanShell to deal with JDK 1.2.x's implicit inclusion
> of rt.jar. I doubt that he did anything about extensions.
> 
> Anyway, this is a wild guess, but I think it's worth a try.

You're *almost* right on, as it turns out; adding the jar files to the
classpath explicitly does indeed make it work.  A little further poking
showed me, however, that it's jde.util.JdeUtilities which isn't taking
account of the extension dirs, not the bsh.  The patch below fixes
this.  It makes *no* attempt to do anything with download extensions
(which I'm not convinced I understand all the ramifications of) but it
does handle installed extensions.

I did perpetuate the assumption in JdeUtilities.java that jar files will
have file extensions of ".zip" or ".jar".  I don't know that that
assumption is always guaranteed to hold, but I also don't know any sane
programmers who'd call their jar files anything else.

Peace,
--Peter



0303326289486015+util$ diff -u JdeUtilities-orig.java JdeUtilities.java
--- JdeUtilities-orig.java      Mon Aug 09 16:00:18 1999
+++ JdeUtilities.java   Mon Aug 09 17:33:46 1999
@@ -62,6 +62,28 @@
     if (classPath2 != null)
       classPath += classPathSeparator + classPath2;
 
+    // Java 2 extension dirs
+    String extClassPath = System.getProperty("java.ext.dirs");
+    if (extClassPath != null) {
+       StringTokenizer stok = new StringTokenizer(extClassPath, 
+                                                  classPathSeparator);
+       while (stok.hasMoreTokens()) {
+           String classPathEntry = stok.nextToken();
+           File currentExtDir = new File(classPathEntry);
+           if (currentExtDir.exists() && currentExtDir.isDirectory()) {
+               // All the files in each dir ought to be zip/jar files
+               String [] files = currentExtDir.list();
+               for (int i = 0; i < files.length; i++) {
+                   if (files[i].toLowerCase().endsWith(".jar") 
+                       || files[i].toLowerCase().endsWith(".zip")) {
+                       classPath += classPathSeparator 
+                           + currentExtDir + File.separator + files[i];
+                   }
+               }
+           }
+       } // end of while (stok.hasMoreTokens())
+    } // end of if (extClassPath != null)
+    
     StringTokenizer st = new StringTokenizer(classPath,
classPathSeparator);
     while (st.hasMoreTokens()) {
       String classPathEntry = st.nextToken();
@@ -77,7 +99,6 @@
       }
     }
 
-    
   }

Reply via email to