Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-1081

JAVA_PLATFORM with spaces (i.e. Mac OS X-ppc-32) breaks bin/hadoop script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.12.0, 0.12.1, 0.13.0
    • 0.13.0
    • scripts
    • None

    Description

      Thus says Brian Whitman in NUTCH-432:

      "In some later nightly in the past few weeks (not sure when) the bin/nutch script stopped working on my Macs with
      Exception in thread "main" java.lang.NoClassDefFoundError: OS
      On any command. I tracked it down to the JAVA_PLATFORM env variable that is used to try to find a native hadoop library. The line
      JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName`
      in bin/nutch returns "Mac OS X-ppc-32", which then appears as
      -Djava.library.path=/Users/bwhitman/Desktop/nn/lib/native/Mac OS X-ppc-32
      in the java command line to start a nutch tool.
      Not sure the best way to fix this, but I manually put
      JAVA_PLATFORM='MacOSX/PPC'
      and the error went away. "

      The same problem occurs in bin/hadoop.

      I propose the following fix:

      JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed -e 's/ /_/g'`

      The alternative would be to fix this in PlatformName, but then we may want to get the real platform name in some other places. We could also add a cmd-line switch to PlatformName.

      Attachments

        1. fix-hadoop-on-darwin.patch
          0.6 kB
          Michael Bieniosek

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ab Andrzej Bialecki
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: