Solved

A different extension folder

Posted on 2004-08-02
9
213 Views
Last Modified: 2012-05-05
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
Comment
Question by:shji1
  • 5
  • 2
  • 2
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11692173
-extdirs <directories>

0
 
LVL 92

Expert Comment

by:objects
ID: 11692179
thats for compiling, am not aware of an option for the vm.
0
 
LVL 92

Expert Comment

by:objects
ID: 11692183
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
 
LVL 1

Author Comment

by:shji1
ID: 11692295
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 92

Accepted Solution

by:
objects earned 150 total points
ID: 11692416
i don't think there is a way to achieve that with the standard class loader.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 11692493
Once the ext classloader has run, you can't change the ext.dirs property
0
 
LVL 1

Author Comment

by:shji1
ID: 11692587
You are right about that, and for now I think I'll just stick to the URLClassLoader.

Thanks anyway!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11692661
:-)
0
 
LVL 92

Expert Comment

by:objects
ID: 11699492
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now