简体   繁体   English

如何在Groovy上导入org.codehaus.groovy.scriptom。*?

[英]How to import org.codehaus.groovy.scriptom.* on Groovy?

I'm trying to run a Groovy app to manipulate Excel files on STS (by SpringSource) 2.3.0. 我正在尝试运行Groovy应用程序以在STS(由SpringSource)2.3.0上操纵Excel文件。

My Groovy version is 1.7. 我的Groovy版本是1.7。

Class: 类:

package com.mytool

import org.codehaus.groovy.scriptom.ActiveXObject


/**
 * @author Mulone
 *
 */
class SurveyTool {

    static main(args) {
        print 'test'
        def wshell = new ActiveXObject('Wscript.Shell')
        wshell.popup("Scriptom is Groovy")
    }

}

Sadly, this is what I get: 可悲的是,这就是我得到的:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\workspace\SurveyTool\src\com\geoadapta\surveytool\SurveyTool.groovy: 6: unable to resolve class org.codehaus.groovy.scriptom.ActiveXObject
 @ line 6, column 1.
   import org.codehaus.groovy.scriptom.ActiveXObject
   ^

1 error

I also tried to rename ActiveXObject to ActiveXProxy with the same result. 我还尝试将ActiveXObject重命名为ActiveXProxy ,结果相同。

I tried to import scriptom manually from the package scriptom-all-assembly-1.6.0 but I didn't work. 我尝试从scriptom-all-assembly-1.6.0包中手动导入scriptom,但是没有用。 Any idea? 任何想法?

Cheers 干杯

运维,我通过手动导入所有jar文件并将jacob-1.14.3-x86.dll放在项目文件夹中进行了修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在groovy中使用scriptom将数据写入Excel? - how to write data to excel using scriptom in groovy? 错误导入 org.codehaus.groovy.grails.commons.ApplicationHolder as AH - error import org.codehaus.groovy.grails.commons.ApplicationHolder as AH Scriptom Groovy格式化Excel示例 - Scriptom Groovy formating Excel Examples 引起:org.codehaus.groovy.control.MultipleCompilationErrorsException - Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException CodeNarc和Groovy:NoSuchMethodError:org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeStaticMethod - CodeNarc and Groovy: NoSuchMethodError: org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeStaticMethod 找不到 org.codehaus.groovy:groovy-all:2.4.12 - Could not find org.codehaus.groovy:groovy-all:2.4.12 Gradle:找不到org.codehaus.groovy:groovy:1.0.0 - Gradle : Could not find org.codehaus.groovy:groovy:1.0.0 我们如何在org.codehaus.groovy.ast.parameter中添加空字符串数组? - How do we add empty string array to org.codehaus.groovy.ast.parameter? 我的 Gradle 构建如何初始化 class org.codehaus.groovy.classgen.Verifier? - How can my Gradle build initialize class org.codehaus.groovy.classgen.Verifier? 没有方法签名:org.codehaus.groovy.runtime.GStringImpl.split() - No signature of method: org.codehaus.groovy.runtime.GStringImpl.split()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM