Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4483865

RFE: No command to change the current working directory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.1
    • core-libs
    • generic
    • generic



      Name: rmT116609 Date: 07/24/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      There is simply no way for one to programmatically change the current
      working directory.

      If I invoke my application from c:\my_directory\, I am stuck in that
      directory. Every file that my application opens or creates must
      either be specified absolutely or must be accessible relative to
      this directory.

      In addition, if I want to use Java Reflection to invoke another Java
      application without spawning another JVM (to save memory), I need a
      way to change the CWD to the directory of the application to be spawned.

      Example:

          Class extClass = Class.forName("ext.MyApplication");
          Class argv[] = { new String[0].getClass() };
          Method extMain = extClass.getMethod("main", argv);

          // Invoke vqServer web server!
          extMain.invoke(null, new Object [] { args });

      The problem is that the enclosing class is not guaranteed (and cannot
      be forced) to start in the home directory of ext.MyApplication.
      (Review ID: 128736)
      ======================================================================

            mr Mark Reinhold
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: