Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

A different extension folder

Is there a way to define or add a different extension directory (other then <JRE>\lib\ext) in a way that the extension class loader will automatically load the JARs in that directory?
(I am trying to avoid writing a custom class loader)

Thanks!
0
shji1
Asked:
shji1
  • 5
  • 2
  • 2
2 Solutions
 
objectsCommented:
-extdirs <directories>

0
 
objectsCommented:
thats for compiling, am not aware of an option for the vm.
0
 
objectsCommented:
YOu should be able to use URLClassLoader instead of writing your own loader.
Would just need to pass it a list of all jar files in the directory.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
shji1Author Commented:
I know about the URLClassLoader, but I am trying to find a simpler way...
For now, I found a very nice (and working) property that is called java.ext.dirs. I can control the extention directory by passing it to the execution line with a -D option.
But this is not good for what I need. I want it to be modfied at runtime (just like using my own the URLClassLoader).
Now I am trying to change this property at runtime, but I guess that this wont work since the class loading architecture does not probe the extention folders (for my knowledge...) during runtime.
0
 
objectsCommented:
i don't think there is a way to achieve that with the standard class loader.
0
 
CEHJCommented:
Once the ext classloader has run, you can't change the ext.dirs property
0
 
shji1Author Commented:
You are right about that, and for now I think I'll just stick to the URLClassLoader.

Thanks anyway!
0
 
CEHJCommented:
:-)
0
 
objectsCommented:
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now