It is based on:
I'm not a java or Eclipse expert so if you see a way to do something better please let me know.
I'm using the Helios release of Eclipse and the Clourdera 3 Beta 4 release for Hadoop.
Setting Up Eclipse
- Download a tarball containing the cloudera source form Cloudera 3 archive
- Unpack the tarball
- In Eclipse create a new project
- In the "Java Settings" dialog set the default output folder to something other than bin
"build/eclipse-classes"
- We do this because the "bin" is used to contain hadoop shell scripts
- Close the project in eclipse
- Copy the contents of the unpacked cloudera tarball to the directory for your new eclipse project e.g
mv some-dir/hadoop-0.20.2-CDH3B4/* ~/workspace/your-project/
- Open the project and refresh it (right click the project and hit F5
- At this point in Eclipse package explorer you should see src listed under your project
- Unfortunately, the src isn't set up properly given the package names
- Setup the src folders in Eclipse
- Right click on properties for your project
- select java build path->source tab
- Remove the entry project/src
- Click add folder and add the following entries
- src/core
- src/contrib/streaming/src/java
- src/mapred
- Set the output folder to project/eclipse-build
- Click on Libraries and add all the jars in
- project/lib
- Click on the menu project and uncheck build automatically
- Create a new ant builder
- Right click on project properties
- Select builders
- Click new and select Ant Builder
- For the buildfile select browse workspace and then select build.xml in your project
- click on targets and set after a "clean"
- compile-core-classes, compile-core
- For manual build set the targets to compile, compile-core-classes, compile-mapred-clases, compile-contrib
- You should now be able to build it by clicking project-> build project
- To debug a file e.g "HadoopStreaming.java" just right click and select debug as "java application"
- If you get a warning about errors in project try clicking on proceed
- The wiki describes an ant task which automatically sets up Eclipse. Unfortunately the eclipse templates don't appear to be included in the cloudera CDH3B4 release. Although you could try downloading them from the Apache repository.
- On another system I had some trouble getting Eclipse to stop at breakpoints. This seems to be java+Eclipse issue.
No comments:
Post a Comment