Solved

A different extension folder

Posted on 2004-08-02
9
247 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
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!

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jsp login check 12 65
Which non-HTML GUI front end to use with Java? 3 67
jmss example java 2 48
Need help aligning JRadioButton that put in a box using GridBagLayout 2 42
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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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 video teaches viewers about errors in exception handling.

739 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