eclipse编译zookeeper

来源:互联网 发布:数据可视化 陈为 网盘 编辑:程序博客网 时间:2024/05/21 14:54

zookeeper需要使用ant进行编译,eclipse中已经集成了ant,编译起来比较方便。需要找到zookeeper项目中的build.xml文件,右键点击,选择Run As->Ant Build



编译过程中,可能提示如下错误:

BUILD FAILED
D:\zookeeper-3.4.5\build.xml:240: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "D:\eclipse\jre"

解决的方法如下:

进入

Window > Preferences > Ant > Runtime > Classpath > Global Entries

点击Add External Jars,进入jdk的安装目录,选择lib/tools.jar。


之后重新编译,问题解决

0 0
原创粉丝点击