-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
generic
-
generic
Name: eaC66865 Date: 12/10/2002
It should be noted that attempts to modify the class loader's
classpath with System.setProperty() is entirely ineffective.
What, if anything, this call does should be documented.
Also, pointers to workarounds would be helpful, since anyone
accessing this API probably wants to add to the classpath
at runtime.
This forum message describes a method that is reported to work:
http://forum.java.sun.com/thread.jsp?forum=32&thread=300557
It hasn't yet worked for me in 1.4.1, however. I'm not
sure why. After invoking it, getProperty("java.class.path")
shows the classpath as unchanged, and I still get class not
found errors. So either it only worked for 1.2, or I've got
other problems...
======================================================================
Additional notes:
* The referenced forum hack does indeed work. However, it is worth
noting that:
a) System.getProperty("java.class.path") does not reflect the change
b) The URL loader class the hack casts the system loader into has
a getURLs() method that *does* reflect the change.
c) It appeared not to work because of the issue reported in bug #4791839,
where System.getProperty("java.home") returns an unexpected value.
###@###.### 2002-12-11
It should be noted that attempts to modify the class loader's
classpath with System.setProperty() is entirely ineffective.
What, if anything, this call does should be documented.
Also, pointers to workarounds would be helpful, since anyone
accessing this API probably wants to add to the classpath
at runtime.
This forum message describes a method that is reported to work:
http://forum.java.sun.com/thread.jsp?forum=32&thread=300557
It hasn't yet worked for me in 1.4.1, however. I'm not
sure why. After invoking it, getProperty("java.class.path")
shows the classpath as unchanged, and I still get class not
found errors. So either it only worked for 1.2, or I've got
other problems...
======================================================================
Additional notes:
* The referenced forum hack does indeed work. However, it is worth
noting that:
a) System.getProperty("java.class.path") does not reflect the change
b) The URL loader class the hack casts the system loader into has
a getURLs() method that *does* reflect the change.
c) It appeared not to work because of the issue reported in bug #4791839,
where System.getProperty("java.home") returns an unexpected value.
###@###.### 2002-12-11
- duplicates
-
JDK-4165411 java.lang.System: Forbid the modification of read-only system properties
-
- Open
-