Modifying java.class.path While JVM running

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hal Vaughan

    Modifying java.class.path While JVM running

    While experimenting with System.getPrope rty() and System.setPrope rty(), I've
    noticed that I can change properties, but those changes do not last once
    the JVM they're modified in terminates.

    I experimented with java.class.path to see if I could extend it while a
    class was running (I think I read about this somewhere, but I can't find it
    again). I'm working on an install program and, if I could add directories
    to java.class.path during the install process, it would allow me to run
    classes that have been installed on the system (I can't do this ahead of
    time because I won't know what path the user selects for the install).

    When I have done this, I can verify that java.class.path has been altered by
    my program, but it seems this added path is ignored by the JVM.

    Is there any way to add paths to the classpath for a running instance of
    JVM?

    It's not necessary, but it is an interesting question. I would think this
    would not be possible because it could cause secuirty problems.

    Any more info appreciated!

    Thanks!

    Hal
Working...