首页

eclipse编译报错Error:An error has occurred.see error log for more details - (groovy..)

标签:Eclipse,error,开发环境,Problem Occurred,groovy     发布时间:2016-05-24   

一、前言

编译groovy项目的时候,报出"An error has occurred. See error log for more details.groovy.lang.GroovySystem.getVersion()Ljava/lang/String;",详情如下图所示

eclipse编译报错Error:An error has occurred.see error log for more details - (groovy..)

二、解决办法

1. 之前打开右击"项目"-"Properties"进行了相关设置,造成项目.project文件配置错位,如下图所示

eclipse编译报错Error:An error has occurred.see error log for more details - (groovy..)

2. 参考设置代码样式如下

<?xml version="1.0" encoding="UTF-8"?>@b@<projectDescription>@b@    <name>templeta</name>@b@    <comment></comment>@b@    <projects>@b@    </projects>@b@    <buildSpec>@b@        <buildCommand>@b@            <name>org.eclipse.wst.common.project.facet.core.builder</name>@b@            <arguments>@b@            </arguments>@b@        </buildCommand>@b@        <buildCommand>@b@            <name>org.codehaus.groovy.eclipse.groovyBuilder</name>@b@            <arguments>@b@            </arguments>@b@        </buildCommand>@b@        <buildCommand>@b@            <name>org.eclipse.jdt.core.javabuilder</name>@b@            <arguments>@b@            </arguments>@b@        </buildCommand>@b@    </buildSpec>@b@    <natures>@b@        <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>@b@        <nature>org.eclipse.jdt.core.javanature</nature>@b@    </natures>@b@</projectDescription>

3. 如通过前1、2步骤仍然报错,右击项目,选择“Properties”,在弹出项目属性窗口,先选“Groovy Compiler”,右边区域Groovy compiler level..设置为“I don't care”,如下图

eclipse编译报错Error:An error has occurred.see error log for more details - (groovy..)

4. 点击菜单“Project(项目)”- “Clean..”,重新编译,能够正常将Groovy文件生成class,说明是选择的groovy编译插件版本不对称造成的。

<<热门下载>>