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

Incorrect handling of CLASSPATH in .java_wrapper

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.4
    • 1.1.2
    • tools
    • None
    • 1.1.4
    • sparc
    • solaris_2.5.1
    • Not verified



      Name: paC48320 Date: 09/18/97


      NOTE: The problem may lie with several other scripts which call
      .java_wrapper (indirectly - through using java).

         The problem can be seen by using rmic with no CLASSPATH variable set.
      It will fail to pick up the class from the current directory.

         If you try using "-classpath ." then it fails to pick up any system
      classes (this may be a separate bug, as isn't this supposed to be
      appended to the system CLASSPATH?).

         In order to get it to work you need to set CLASSPATH=., which is
      contrary to the usage of java, javac etc.

         The problem is that several of the interlude scripts (appletviewer,
      javadoc, native2ascii, rmic, rmiregistry & serialver) contain this:

      CLASSPATH="$CLASSPATH"
      export CLASSPATH

      which will produce an empty (null) value for CLASSPATH if you do not
      have one set. These scripts ten go on to use java, which is a symlink to
      .java_wrapper.

         The code in .java_wrapper contains:

      CLASSPATH="${CLASSPATH-.}"

      which sets a value of '.' *only* if CLASSPATH does not exist. But when
      you get here through rmic this *is* set, albeit to nothing. The result
      is that '.' is not on the CLASSPATH (and people 'phone me up to find out
      why rmic doesn't work :-().

         The cure is to add a colon to the setting, so that null values are
      ignored also.

      company - Glaxo Wellcome , email - ###@###.###
      ======================================================================

            apalanissunw Anand Palaniswamy (Inactive)
            pallenba Peter Allenbach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: