FAQ
Hello,

I'm trying to run the example from the quick start guide on Windows and I
get this error:

$ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
Exception in thread "main" java.lang.NoClassDefFoundError:
Caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: . Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError:
Gross\Documents\Projects\discom\hadoop-0/21/0\logs
Caused by: java.lang.ClassNotFoundException:
Gross\Documents\Projects\discom\hadoop-0.21.0\logs
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class:
Gross\Documents\Projects\discom\hadoop-0.21.0\logs. Program will exit.

Does anyone know what I need to change?

Thank you.

From, Drew

--
Forget the environment. Print this e-mail immediately. Then burn it.

Search Discussions

  • Madhu phatak at Jun 21, 2011 at 10:25 am
    I think the jar have some issuses where its not able to read the Main class
    from manifest . try unjar the jar and see in Manifest.xml what is the main
    class and then run as follows

    bin/hadoop jar hadoop-*-examples.jar <Full qualified main class> grep input
    output 'dfs[a-z.]+'
    On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross wrote:

    Hello,

    I'm trying to run the example from the quick start guide on Windows and I
    get this error:

    $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Caused by: java.lang.ClassNotFoundException:
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: . Program will exit.
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs. Program will exit.

    Does anyone know what I need to change?

    Thank you.

    From, Drew

    --
    Forget the environment. Print this e-mail immediately. Then burn it.
  • Drew Gross at Jun 22, 2011 at 4:26 am
    Thanks Jeff, it was a problem with JAVA_HOME. I have another problem
    now though, I have this:

    $JAVA:  /cygdrive/c/Program Files/Java/jdk1.6.0_26/bin/java
    $JAVA_HEAP_MAX:  -Xmx1000m
    $HADOOP_OPTS:  -Dhadoop.log.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\ -Dhadoop.id.str=
    -Dhadoop.root.logger=INFO,console
    -Djava.library.path=/cygdrive/c/Users/Drew
    Gross/Documents/Projects/discom/hadoop-0.21.0/lib/native/
    -Dhadoop.policy.file=hadoop-policy.xml
    $CLASS:  org.apache.hadoop.util.RunJar
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will
    exit.

    (This is with some extra debugging info added by me in bin/hadoop)

    It looks like the windows style file names are causing problems,
    especially the spaces. Has anyone encountered this before, and know
    how to fix? I tried escaping the spaces and surrounding the file paths
    with quotes (not at the same time), but that didn't help.

    Drew

    On Tue, Jun 21, 2011 at 6:24 AM, madhu phatak wrote:

    I think the jar have some issuses where its not able to read the Main class
    from manifest . try unjar the jar and see in Manifest.xml what is the main
    class and then run as follows

    bin/hadoop jar hadoop-*-examples.jar <Full qualified main class> grep input
    output 'dfs[a-z.]+'
    On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross wrote:

    Hello,

    I'm trying to run the example from the quick start guide on Windows and I
    get this error:

    $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Caused by: java.lang.ClassNotFoundException:
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: .  Program will exit.
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will exit.

    Does anyone know what I need to change?

    Thank you.

    From, Drew

    --
    Forget the environment. Print this e-mail immediately. Then burn it.


    --
    Forget the environment. Print this e-mail immediately. Then burn it.
  • Devaraj K at Jun 22, 2011 at 5:53 am
    Drew,
    Running hadoop on windows is not supported.

    You can build/test hadoop on windows using Cygwin but if you want to run,
    you will face many problems.

    Devaraj K
    ---------------------------------------------------------------------
    From: Drew Gross
    Sent: Wednesday, June 22, 2011 9:56 AM
    To: common-user@hadoop.apache.org
    Subject: Re: ClassNotFoundException while running quick start guide on
    Windows.

    Thanks Jeff, it was a problem with JAVA_HOME. I have another problem
    now though, I have this:

    $JAVA:  /cygdrive/c/Program Files/Java/jdk1.6.0_26/bin/java
    $JAVA_HEAP_MAX:  -Xmx1000m
    $HADOOP_OPTS:  -Dhadoop.log.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\ -Dhadoop.id.str=
    -Dhadoop.root.logger=INFO,console
    -Djava.library.path=/cygdrive/c/Users/Drew
    Gross/Documents/Projects/discom/hadoop-0.21.0/lib/native/
    -Dhadoop.policy.file=hadoop-policy.xml
    $CLASS:  org.apache.hadoop.util.RunJar
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will
    exit.

    (This is with some extra debugging info added by me in bin/hadoop)

    It looks like the windows style file names are causing problems,
    especially the spaces. Has anyone encountered this before, and know
    how to fix? I tried escaping the spaces and surrounding the file paths
    with quotes (not at the same time), but that didn't help.

    Drew
  • Sandy Pratt at Jun 22, 2011 at 5:57 pm
    Hi Drew,

    I don't know if this is actually the issue or not, but the output below makes me think you might be passing Cygwin pathes into the java.exe launcher. If that's the case, it won't work. java.exe is pure Windows and doesn't know about '/cygdrive/c' for example (it also expects the path separator to be semicolon rather than colon). Every once in a while when I try to use java.exe from the Cygwin CLI on my Windows box, I get bitten by this.

    Sandy
    -----Original Message-----
    From: Drew Gross
    Sent: Tuesday, June 21, 2011 21:26
    To: common-user@hadoop.apache.org
    Subject: Re: ClassNotFoundException while running quick start guide on
    Windows.

    Thanks Jeff, it was a problem with JAVA_HOME. I have another problem now
    though, I have this:

    $JAVA:  /cygdrive/c/Program Files/Java/jdk1.6.0_26/bin/java
    $JAVA_HEAP_MAX:  -Xmx1000m
    $HADOOP_OPTS:  -Dhadoop.log.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=C:\Users\Drew
    Gross\Documents\Projects\discom\hadoop-0.21.0\ -Dhadoop.id.str= -
    Dhadoop.root.logger=INFO,console
    -Djava.library.path=/cygdrive/c/Users/Drew
    Gross/Documents/Projects/discom/hadoop-0.21.0/lib/native/
    -Dhadoop.policy.file=hadoop-policy.xml
    $CLASS:  org.apache.hadoop.util.RunJar
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will exit.

    (This is with some extra debugging info added by me in bin/hadoop)

    It looks like the windows style file names are causing problems, especially the
    spaces. Has anyone encountered this before, and know how to fix? I tried
    escaping the spaces and surrounding the file paths with quotes (not at the
    same time), but that didn't help.

    Drew

    On Tue, Jun 21, 2011 at 6:24 AM, madhu phatak wrote:

    I think the jar have some issuses where its not able to read the Main
    class from manifest . try unjar the jar and see in Manifest.xml what
    is the main class and then run as follows

    bin/hadoop jar hadoop-*-examples.jar <Full qualified main class> grep
    input output 'dfs[a-z.]+'
    On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross wrote:

    Hello,

    I'm trying to run the example from the quick start guide on Windows
    and I get this error:

    $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Caused by: java.lang.ClassNotFoundException:
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at
    sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: .  Program will exit.
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Gross\Documents\Projects\discom\hadoop-0/21/0\logs
    Caused by: java.lang.ClassNotFoundException:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at
    sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class:
    Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will
    exit.
    Does anyone know what I need to change?

    Thank you.

    From, Drew

    --
    Forget the environment. Print this e-mail immediately. Then burn it.


    --
    Forget the environment. Print this e-mail immediately. Then burn it.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedJun 16, '11 at 5:33a
activeJun 22, '11 at 5:57p
posts5
users4
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase