0
Windows 7에서 scriptom 1.6을 사용하여 Excel 응용 프로그램에 연결하려고합니다. 그러나 나는 오류가 계속 :Groovy 1.7.10에서 Scriptom 1.6을 사용하는 java.lang.IncompatibleClassChangeError
import org.codehaus.groovy.scriptom.ActiveXObject;
class GoExcel {
public static void main(String[] args) {
ActiveXObject excel = new ActiveXObject("Excel.Application")
excel.Visible = true;
}
}
과 받는다는 파일 :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.examples</groupId>
<name>${project.artifactId}</name>
<artifactId>go_excel</artifactId>
<packaging>jar</packaging>
<version>0.1</version>
<properties>
<gmaven.version>1.2</gmaven.version>
<groovy.version>1.7.10</groovy.version>
<slf4j.version>1.5.10</slf4j.version>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.13</version>
</dependency>
<!-- scriptom -->
<dependency>
<groupId>org.codehaus.groovy.modules.scriptom</groupId>
<artifactId>scriptom</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>net.sf.jacob-project</groupId>
<artifactId>jacob</artifactId>
<version>1.14.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.jacob-project</groupId>
<artifactId>jacob</artifactId>
<version>1.14.3</version>
<type>dll</type>
<classifier>x64</classifier>
</dependency>
<dependency>
<groupId>net.sf.jacob-project</groupId>
<artifactId>jacob</artifactId>
<version>1.14.3</version>
<type>dll</type>
<classifier>x86</classifier>
</dependency>
<!--/scriptom -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<projectnatures>
<projectnature>org.eclipse.jdt.groovy.core.groovyNature
</projectnature>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
</projectnatures>
</configuration>
</plugin>
</plugins>
</build>
</project>
난 그냥 아이디어의 부족 여기
Caught: java.lang.IncompatibleClassChangeError: Class org.codehaus.groovy.scriptom.ActiveXObject does not implement the requested interface groovy.lang.GroovyObject
at GoBeby.main(GoBeby.groovy:14)
은 내 코드입니다. jacob 64 비트와 32 비트 dll을 사용하고 Groovy 프레임 워크를 1.5로 변경합니다. 아무에게도 어떻게 작동하게 할 생각이 있습니까?
불행하게도 Scriptom 1.6.0가 작동하지 않습니다 그루비 1.6.0 중 하나를 잡았다 : java.lang.IncompatibleClassChangeError은 : 클래스 org.codehaus.groovy.scriptom.ActiveXObject가 요청 된 인터페이스를 구현하지 않습니다 groovy.lang.GroovyObject \t에서 GoBeby.main (GoExcel.groovy : 14). 나는 잘못 생각할 수있는 것들이 부족합니다. – Skarab