簡體   English   中英

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

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

我正在嘗試運行Groovy應用程序以在STS(由SpringSource)2.3.0上操縱Excel文件。

我的Groovy版本是1.7。

類:

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")
    }

}

可悲的是,這就是我得到的:

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

我還嘗試將ActiveXObject重命名為ActiveXProxy ,結果相同。

我嘗試從scriptom-all-assembly-1.6.0包中手動導入scriptom,但是沒有用。 任何想法?

干杯

運維,我通過手動導入所有jar文件並將jacob-1.14.3-x86.dll放在項目文件夾中進行了修復

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM