You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hama.apache.org by Chui-Hui Chiu <cc...@tigers.lsu.edu> on 2012/08/15 04:03:36 UTC

How to compile a new Hama application?

Hello,

I tried to compile a new Hama application in the following environment but
always get tons of error messages.

The Hadoop package is unzipped to <Hadoop root>.
The Hama package is unzipped to <Hama root>.
The Hama source code is in <Hama source root>.

I typed the following command to compile.
javac -classpath "<Hadoop root>/*.jar:<Hama root>/*.jar" <full path to my
source file>

The error messages are about many missing Hadoop and Hama packages.
I am new to Java.  Doesn't the -classpath include all necessary packages?
What do I miss?


Many thanks,
Chiu

Re: How to compile a new Hama application?

Posted by Thomas Jungblut <th...@gmail.com>.
I believe that your command line interpreter does not subtitude the
wildcard correctly (mine does neither).
So directly talking to the jars seems to fix this:
javac -cp
/usr/local/hama/hama-core-0.5.0.jar:/usr/local/hadoop/hadoop-core-1.0.1.jar:/usr/local/hama/hama-graph-0.5.0.jar:
SSSP.java

will be compiled to the SSSP.class and their subclasses.

Hope this also fixes it for you ;)

2012/8/15 Chui-Hui Chiu <cc...@tigers.lsu.edu>

> Hello,
>
> I tried to compile an official example, SSSP, with the following command.
> javac -classpath "<Hama root>/*.jar:<Hadoop root>/*.jar" <Hama source
> root>/examples/src/main/java/org/apache/hama/examples/SSSP.java
>
> This is one of the 76 similar error messages.
> <Hama source
> root>/examples/src/main/java/org/apache/hama/examples/SSSP.java:23: package
> org.apache.hadoop.fs does not exist
> import org.apache.hadoop.fs.Path;
>
> The pre-built packages seem to be not properly imported.  Do you have any
> idea?
>
>
> Mnay thanks,
> Chiu
>
> On Wed, Aug 15, 2012 at 3:47 AM, Thomas Jungblut
> <th...@gmail.com>wrote:
>
> > Hi,
> >
> > actually this should work, do you have a stacktrace or a specific error
> > that you could link?
> >
> > I would recommend you to use an IDE like eclipse for the compiling, or a
> > build tool like maven.
> > Hope it helps you a little.
> >
> > 2012/8/15 Chui-Hui Chiu <cc...@tigers.lsu.edu>
> >
> > > Hello,
> > >
> > > I tried to compile a new Hama application in the following environment
> > but
> > > always get tons of error messages.
> > >
> > > The Hadoop package is unzipped to <Hadoop root>.
> > > The Hama package is unzipped to <Hama root>.
> > > The Hama source code is in <Hama source root>.
> > >
> > > I typed the following command to compile.
> > > javac -classpath "<Hadoop root>/*.jar:<Hama root>/*.jar" <full path to
> my
> > > source file>
> > >
> > > The error messages are about many missing Hadoop and Hama packages.
> > > I am new to Java.  Doesn't the -classpath include all necessary
> packages?
> > > What do I miss?
> > >
> > >
> > > Many thanks,
> > > Chiu
> > >
> >
>

Re: How to compile a new Hama application?

Posted by Chui-Hui Chiu <cc...@tigers.lsu.edu>.
Hello,

I tried to compile an official example, SSSP, with the following command.
javac -classpath "<Hama root>/*.jar:<Hadoop root>/*.jar" <Hama source
root>/examples/src/main/java/org/apache/hama/examples/SSSP.java

This is one of the 76 similar error messages.
<Hama source
root>/examples/src/main/java/org/apache/hama/examples/SSSP.java:23: package
org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.Path;

The pre-built packages seem to be not properly imported.  Do you have any
idea?


Mnay thanks,
Chiu

On Wed, Aug 15, 2012 at 3:47 AM, Thomas Jungblut
<th...@gmail.com>wrote:

> Hi,
>
> actually this should work, do you have a stacktrace or a specific error
> that you could link?
>
> I would recommend you to use an IDE like eclipse for the compiling, or a
> build tool like maven.
> Hope it helps you a little.
>
> 2012/8/15 Chui-Hui Chiu <cc...@tigers.lsu.edu>
>
> > Hello,
> >
> > I tried to compile a new Hama application in the following environment
> but
> > always get tons of error messages.
> >
> > The Hadoop package is unzipped to <Hadoop root>.
> > The Hama package is unzipped to <Hama root>.
> > The Hama source code is in <Hama source root>.
> >
> > I typed the following command to compile.
> > javac -classpath "<Hadoop root>/*.jar:<Hama root>/*.jar" <full path to my
> > source file>
> >
> > The error messages are about many missing Hadoop and Hama packages.
> > I am new to Java.  Doesn't the -classpath include all necessary packages?
> > What do I miss?
> >
> >
> > Many thanks,
> > Chiu
> >
>

Re: How to compile a new Hama application?

Posted by Thomas Jungblut <th...@gmail.com>.
Hi,

actually this should work, do you have a stacktrace or a specific error
that you could link?

I would recommend you to use an IDE like eclipse for the compiling, or a
build tool like maven.
Hope it helps you a little.

2012/8/15 Chui-Hui Chiu <cc...@tigers.lsu.edu>

> Hello,
>
> I tried to compile a new Hama application in the following environment but
> always get tons of error messages.
>
> The Hadoop package is unzipped to <Hadoop root>.
> The Hama package is unzipped to <Hama root>.
> The Hama source code is in <Hama source root>.
>
> I typed the following command to compile.
> javac -classpath "<Hadoop root>/*.jar:<Hama root>/*.jar" <full path to my
> source file>
>
> The error messages are about many missing Hadoop and Hama packages.
> I am new to Java.  Doesn't the -classpath include all necessary packages?
> What do I miss?
>
>
> Many thanks,
> Chiu
>