开发者

java.ext.dirs System Property in Java

I'm using JDK 1.6 on Windows XP OS. Running a simple Java program to print the value of java.ext.dirs System property:

System.getProperty("java.ext.dirs")

prints:

C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext

Out of the two directory that got printed, the second o开发者_高级运维ne does not exists on my system i.e. C:\WINDOWS\Sun\Java\lib\ext directory is not available in my system.

I'm not understanding, why then Java returns this illegal directory value for java.ext.dirs property? And how can i eliminate this value from java.ext.dirs property?


I'm not understanding, why then Java returns this illegal directory value for java.ext.dirs property?

It is returning the places that the JVM will look. If there is a non-existent directory in the list, I'd expect it to be silently ignored. Are you observing something different?

And how can i eliminate this value from java.ext.dirs property?

My reading of this page is that you should be able to set the property. (The same page explains how the path is used, and how the default is determined.)

You probably need to set it via the command line; e.g using -Djava.ext.dirs=.... I'd expect changes to the property made after the JVM had bootstrapped to have no effect.


Those are directories in which Java will look for extensions. If one of the directories isn't there, no extensions will be found there -- no big deal, why does it matter?

In any case, you can provide -Djava.ext.dirs=PATH on the Java command line, if you'd like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜