编译hadoop 有错 'java5.home' is not defined
来源:互联网 发布:游戏爆率算法 编辑:程序博客网 时间:2024/06/06 14:04
编译hadoop 有错 'java5.home' is not defined
2011年12月27日 星期二 12:34
参考:http://hadoop.hadoopor.com/thread-941-1-1.html
http://trac.nchc.org.tw/cloud/wiki/waue/2010/0211
可能有时候因为eclipse版本或者操作系统版本的问题使得hadoop 提供的 eclipse plugin不太好用。可以自己生成
1.修改$HADOOP_HOME/src/contrib/build-contrib.xml
增加一行:<property name="eclipse.home" location="/home/gushui/eclipse"/>
上句后面的/home/gushui/eclipse由自己的$ECLIPSE_HOME代替
2.修改 $HADOOP_HOME/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/launch/HadoopApplicationLaunchShortcut.java
注释掉原来的//import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;
改为import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;
3.执行:
cd $HADOOP_HOME
ant compile
ln -sf $HADOOP_HOME/docs $HADOOP_HOME/build/docs
ant package
4.在执行最后一句的时候会遇到问题:build.xml:908: 'java5.home' is not defined. Forrest requires Java 5. Please pass -Djava5.home=<base 5="" distribution> to Ant on the command-line.
说没有define java5的home目录,因为我装的是java6
去下一个java5: sudo apt-get install sun-java5-jdk
再去下一个apache-forrest-0.8:http://forrest.apache.org/mirrors.cgi For UNIX operating systems: apache-forrest-0.8.tar.gz
解压后,(如我放在 /home/gushui/src/apache-forrest-0.8)
则重新执行命令:ant package -Djava5.home=/usr/lib/jvm/java-1.5.0-sun-1.5.0.19 -Dforrest.home=/home/gushui/src/apache-forrest-0.8
or ant package -Dcompile.native=true -Dcompile.c++=true -Djava5.home=/home/hadoop/jdk1.5.0_16 -Dforrest.home=/usr/local/apache-forrest-0.8
注意上面的java5路径和apache-forrest路径要根据你自己的安装路径而设定
ok,应该会在$HADOOP_HOME/build/contrib/eclipse-plugin/hadoop-0.20.3-dev-eclipse-plugin.jar
修改名字为hadoop-0.20.2-eclipse-plugin.jar,搞定。至于为什么要修改我也不太清楚,版本本身是0.20.2的,它却跳出来0.20.3。
5.注意几点:
(1)把这个jar包放到eclipse 的plugins目录下。重启eclipse。我的貌似不行,用了最笨的办法,把eclipse删掉再重新解压tar文件重装,后面可以了
(2)zz,我的也是这样:如果你的eclipse 的 run as -> run on hadoop 功能按了還是沒有反應的話,請先執行 run as -> java application ,再 run as -> run on hadoop 就可以了
来源:http://hi.baidu.com/xxjjyy2008/blog/item/7b5ed10f20e6a9346059f335.html
http://trac.nchc.org.tw/cloud/wiki/waue/2010/0211
可能有时候因为eclipse版本或者操作系统版本的问题使得hadoop 提供的 eclipse plugin不太好用。可以自己生成
1.修改$HADOOP_HOME/src/contrib/build-contrib.xml
增加一行:<property name="eclipse.home" location="/home/gushui/eclipse"/>
上句后面的/home/gushui/eclipse由自己的$ECLIPSE_HOME代替
2.修改 $HADOOP_HOME/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/launch/HadoopApplicationLaunchShortcut.java
注释掉原来的//import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;
改为import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;
3.执行:
cd $HADOOP_HOME
ant compile
ln -sf $HADOOP_HOME/docs $HADOOP_HOME/build/docs
ant package
4.在执行最后一句的时候会遇到问题:build.xml:908: 'java5.home' is not defined. Forrest requires Java 5. Please pass -Djava5.home=<base 5="" distribution> to Ant on the command-line.
说没有define java5的home目录,因为我装的是java6
去下一个java5: sudo apt-get install sun-java5-jdk
再去下一个apache-forrest-0.8:http://forrest.apache.org/mirrors.cgi For UNIX operating systems: apache-forrest-0.8.tar.gz
解压后,(如我放在 /home/gushui/src/apache-forrest-0.8)
则重新执行命令:ant package -Djava5.home=/usr/lib/jvm/java-1.5.0-sun-1.5.0.19 -Dforrest.home=/home/gushui/src/apache-forrest-0.8
or ant package -Dcompile.native=true -Dcompile.c++=true -Djava5.home=/home/hadoop/jdk1.5.0_16 -Dforrest.home=/usr/local/apache-forrest-0.8
注意上面的java5路径和apache-forrest路径要根据你自己的安装路径而设定
ok,应该会在$HADOOP_HOME/build/contrib/eclipse-plugin/hadoop-0.20.3-dev-eclipse-plugin.jar
修改名字为hadoop-0.20.2-eclipse-plugin.jar,搞定。至于为什么要修改我也不太清楚,版本本身是0.20.2的,它却跳出来0.20.3。
5.注意几点:
(1)把这个jar包放到eclipse 的plugins目录下。重启eclipse。我的貌似不行,用了最笨的办法,把eclipse删掉再重新解压tar文件重装,后面可以了
(2)zz,我的也是这样:如果你的eclipse 的 run as -> run on hadoop 功能按了還是沒有反應的話,請先執行 run as -> java application ,再 run as -> run on hadoop 就可以了
来源:http://hi.baidu.com/xxjjyy2008/blog/item/7b5ed10f20e6a9346059f335.html
- 编译hadoop 有错 'java5.home' is not defined
- PANIC: HOME is defined but could not find Nexus_S_API_21.ini file in $HOME/.android/avd
- PANIC: HOME is defined but could not find Nexus_5_API_22_64-x86.ini file in $HOME/.android/avd
- Ext is not defined
- $ is not defined error
- $ is not defined error
- dojo is not defined!
- $ is not defined
- $ is not defined 问题
- Ext is not defined
- Ext is not defined
- $ is not defined
- jQuery is not defined
- ReferenceError: $ is not defined
- Ext is not defined
- $ is not defined
- d3 is not defined
- CERT_NONE is not defined
- 深入学习Python内置数据类型之——字典(Dictionary)
- QTreeView对象如何设置行高(Row Height)?
- Spring的PathMatchingResourcePatternResolver使用classpath*时jar包资源无法匹配BUG
- busybox编译
- [delphi] 让AllocateHwnd接受一般函数地址作参数
- 编译hadoop 有错 'java5.home' is not defined
- 再见腾讯,创业我来了!!!
- 面向对象编程初步
- Java基础10-接口,抽象类以及异常
- tomcat启动报错 java.net.SocketException: select failed
- TCO2012Round1A-2-EllysFractions
- 今天所遇到的问题
- dp跳棋
- 与未知同行:论敏捷开发中的反馈与反复