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

jre doesn't allow you to specify library paths

XMLWordPrintable

    • 1.1.6
    • generic, sparc
    • solaris_2.5.1, solaris_2.6
    • Verified

      Name: mf23781 Date: 12/04/97

      ****** DEFECT 3929 *****************************************************

      In src/unix/java/jre/jre_md.c, there's a function called
      SetLibraryPath, which contains a typo:

      /*
       * Sets LIBPATH to include the specified directory.
       */
      void
      SetLibraryPath(const char *dir)
      {
          char *s = getenv("LIBPATH"), *buf;

          /* Set library path */
          if (s == 0) {
              sprintf(buf, "LIBPATH=%s:%s", dir, s);
          } else {
              buf = JRE_Malloc(strlen(dir) + 32);
              sprintf(buf, "LIBPATH=%s", dir);
          }
          if (putenv(buf) != 0) {
              perror("putenv");
              exit(1);
          }
      }


      It should say "if (s != 0) {".

      "s == 0" makes it so that if you set library paths in the jre,
      they are ignored.


      ======================================================================

            dconnellsunw David Connelly (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: