2017-01-09 12 views
0

.jarライブラリを.dllに変換しようとすると、IKVMフレームワークが動作しなくなります。 いくつかのJavaプロジェクトで正常にテストされていますので、うまく動作するJavaライブラリを作成しましたが、.NETの.dllが強く必要です。IKVM jar to dllの問題

私は、コマンドを起動すると:

ikvm -jar mylib.jar 

すべてが(:それは動作します私も確かにメインのファイルで試してみました)okです。 I型

しかし、:

ikvmc -target:library mylib.jar 

私は警告の多くを得たが、まだそれは、.dllファイルを作成します。すべての警告は私のプロジェクトでは使わないライブラリに関連していると言っておくことは重要ですが、私にとって必須のMavenでインポートしたパッケージにあることは間違いありません。 私は本当の問題は、この段階であれば、私はこれらの警告を無視してオンラインで読むので、わかりませんが、私は、出力の少しを投稿してくださいする:

warning IKVMC0100: Class "junit.framework.TestCase" not found 
warning IKVMC0100: Class "javax.servlet.http.HttpServlet" not found 
warning IKVMC0100: Class "javax.servlet.ServletOutputStream" not found 
warning IKVMC0100: Class "org.junit.Assert" not found 
warning IKVMC0100: Class "junit.framework.TestSuite" not found 
warning IKVMC0100: Class "org.apache.tools.ant.taskdefs.MatchingTask" not found 

は、私たちは、このステップはOKだとしましょう今は、私のC#アプリケーションの参考文献のIKVMライブラリとmylib.dllファイルをインポートする必要があります。私はやったが、結果はかなり変わった。オートコンプリート環境では、他のクラスの99%を無視して、4つのJavaクラスのみを使用するように提案している。私は何かが間違っていたと思うが、それをどこでどのように修正するかを理解するのはかなり難しい。

さらに詳しい情報:Maven、Java8(sdk 1.8)、IKVM 8を使用しています。 IKVM 7でも同じことを試みましたが、同じエラーが発生しました。最後に が、これは私のpom.xmlです:

<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/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>org.fra.mylibrary</groupId> 
<artifactId>MyLibrary</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<name>MYLIBRARY</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

<!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/owlapi-distribution --> 
<dependencies> 
    <!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/owlapi-distribution --> 
    <dependency> 
     <groupId>net.sourceforge.owlapi</groupId> 
     <artifactId>owlapi-distribution</artifactId> 
     <version>4.1.3</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/org.antlr/antlr4-runtime --> 
    <dependency> 
     <groupId>org.antlr</groupId> 
     <artifactId>antlr4-runtime</artifactId> 
     <version>4.5.3</version> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.7.21</version> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all --> 
    <dependency> 
     <groupId>org.codehaus.groovy</groupId> 
     <artifactId>groovy-all</artifactId> 
     <version>2.4.7</version> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/jfact --> 
    <dependency> 
     <groupId>net.sourceforge.owlapi</groupId> 
     <artifactId>jfact</artifactId> 
     <version>4.0.4</version> 
    </dependency> 



</dependencies> 

<build> 
    <plugins> 
     <!-- ANTLR4 --> 
     <plugin> 
      <groupId>org.antlr</groupId> 
      <artifactId>antlr4-maven-plugin</artifactId> 
      <version>4.5.3</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>antlr4</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
      </configuration> 
     </plugin> 

     <!-- Maven Assembly Plugin to create Jar --> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>single</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
      </configuration> 
     </plugin> 

     <!-- Maven Compiler Plugin --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.6.0</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 

    </plugins> 
</build> 

答えて

0

だけの方法とクラスの最新バージョンに関連するすべてのコードを削除、およびJavaのライブラリーの下位バージョンに変更し、それが動作する可能性があり同じようなエラーがありますので、