ant打包报错 JRE version less than 1.8 is not suppored
ant 打包错误如下 :
解决方案 :
使用 apache-ant-1.9.15 及之下版本的ant
编辑工作空间下文件 .metadata/.plugins/org.eclipse.debug.core/.launches/项目名 build.xml.launch , 添加红色部分代码
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType"> <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/项目名/build.xml"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_39" path="1" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento antHome="D:/apache-ant-1.9.15"/> </runtimeClasspathEntry> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_39"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="项目名"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="init,clean,generwar,compile1,compile2,copy1,ok,"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/项目名/build.xml}"/> <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/> </launchConfiguration>
注意里面的ant和jdk配置