Solved

A different extension folder

Posted on 2004-08-02
9
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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
 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

630 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