build.xml:278: Unable to find a javac compiler;
来源:互联网 发布:网络固定电话软件 编辑:程序博客网 时间:2024/06/08 19:11
使用Ant编译openfire出现问题:
build.xml:278: 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 "C:\Program Files\Java\jre7"
解决:
一.下载jdk,地址http://wh.uzzf.com//jxl/jdk-windows-32_setup.zip
二.配置jdk环境
1.右键选择 计算机→属性→高级系统设置→高级→环境变量
2.系统变量→新建
变量名:JAVA_HOME
变量值:(变量值填写你的jdk的安装目录,例如本人是 E:\Program Files\Java\jdk1.7.0_45)
3.在系统变量中找到 Path 变量,选择编辑
在变量值最后输入 %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
(注意如果原来Path的变量值末尾没有;号,就先输入;号再输入上面的代码)
4.系统变量→新建
变量名:CLASSPATH
变量值:.%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar(注意最前面有一点)
到这系统变量就配置完毕了。
5.检验jdk是否配置成功:运行cmd 输入 java -version (java 和 -version 之间有空格)
三.在eclipse中配置
windows->preferences->ant-> Runtime->Classpath->Ant Home Entries->Add External JARs,添加了jdk下面的/lib/tools.jar后,编译通过
参考:http://www.uzzf.com/soft/395.html
http://hi.baidu.com/queryworld/item/40b1ddedce7da4fd2b09a440
- build.xml:278: Unable to find a javac compiler;
- build.xml:278: Unable to find a javac compiler;
- eclipse ant错误:ant build.xml Unable to find a javac compiler解决
- Unable to find a javac compiler
- Unable to find a javac compiler
- Unable to find a javac compiler
- Unable to find a javac compiler,
- Unable to find a javac compiler---JBOSS
- Unable to find a javac compiler错误之解决办法
- Jsp运行时报错:“Unable to find a javac compiler ”
- eclipse ant 的时候 Unable to find a javac compiler
- java 调 ant 出现 Unable to find a javac compiler
- web maven jetty Unable to find a javac compiler
- Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK解决
- Ant Unable to find a javac compiler Perhaps JAVA_HOME does not point to the JDK 解决办法
- 环境变量设置无误,但Tomcat仍报“Unable to find a javac compiler”错误的排除
- ant 中 fork = true,解决Unable to find a javac compiler
- Linux上机笔记(2) vim 下编写C语言
- 写了一个Java的简单缓存模型
- nodejs 网址收集
- ZOJ 3466 The Hive II
- 【mongoDB】 备份
- build.xml:278: Unable to find a javac compiler;
- 本人的cocos2d-x之路
- 天空的心事,只有云懂
- 如何建立独立博客
- 借助TPM实现软件的版权保护和授权体系
- 推荐系统
- 的风格化发的爽肤水
- Amazon DynamoDB简介(一)
- 数据库连接池的Java实现