eclipse中执行Ant脚本:Class not found: javac1.8
2017-05-28 10:58
567 查看
最近把eclipse也升级到neon,java也同步升级到1.8,在eclipse中执行很久之前写的ant脚本(build.xml)时报错了:
Class not found: javac1.8
在命令行中执行ant脚本是正常的,因为我的电脑中安装了java1.6,1.7,1.8,但默认的版本是1.6,我知道我的ant脚本中指定了生成目标版本(target)是1.6。
在网上查了资料后,搞清楚了原因,原来是Ant版本太低,低于1.9,无法和java1.8兼容。于是到http://ant.apache.org/bindownload.cgi下载了1.10.1,解压到本地后,如下图修改了eclipse中的ant主目录参数,指定使用1.10.1。
再重新执行,恢复正常。
参考资料:
《Class not found: javac1.8”问题总结》
《 Could not find the main class: org.eclipse.ant.internal.launching.remote.InternalAntRunner》
Class not found: javac1.8
在命令行中执行ant脚本是正常的,因为我的电脑中安装了java1.6,1.7,1.8,但默认的版本是1.6,我知道我的ant脚本中指定了生成目标版本(target)是1.6。
在网上查了资料后,搞清楚了原因,原来是Ant版本太低,低于1.9,无法和java1.8兼容。于是到http://ant.apache.org/bindownload.cgi下载了1.10.1,解压到本地后,如下图修改了eclipse中的ant主目录参数,指定使用1.10.1。
再重新执行,恢复正常。
参考资料:
《Class not found: javac1.8”问题总结》
《 Could not find the main class: org.eclipse.ant.internal.launching.remote.InternalAntRunner》
相关文章推荐
- Eclipse使用Ant编译提示Class not found: javac1.8【转载】
- Eclipse中执行Ant脚本出现Could not find the main class的问题及解
- Ant: Class not found: javac1.8
- Ant: Class not found: javac1.8
- 使用Ant编译提示Class not found: javac1.8
- eclipse中使用ant编译时,执行到javac命令后就停止执行解决办法
- ant 执行javac时,提示warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set
- build.xml: 21: Class not found: javac1.8
- 搭建后台运行环境记录暨解决Kepler SR1支持jdk1.8和\ant\build.xml:115: Class not found: javac1.8错误
- Eclipse/MyEclipse设置在保存文件时自动调用Ant脚本执行一些构建操作
- Eclipse中执行Ant出现Could not find the main class的问题及解
- 在Eclipse里调用ANT时,如何使javac编译出错提示为英文而非中文?
- 执行ant脚本时,提示 Specified VM install not found: type Standard VM, name Java
- ant 执行到javac时停止解决方法
- android 下用ant编译脚本执行批量渠道打包
- Eclipse下好使,但是cmd下执行java运行class文件提示Exception in thread "main" java.lang.NoClassDefFoundError问题
- 用ant脚本执行sql语句
- 我的Eclipse编译打包ant脚本
- ClassPath in Ant for Javac task
- classpath设置、javac/java执行class问题