当前位置: 首页 > 知识库问答 >
问题:

IKVM jar到dll问题

邢洋
2023-03-14

我很难尝试将我的.jar库转换为.dll并使其通过IKVM框架工作。我编写了一个Java库,由于它已经在几个Java项目中进行了成功的测试,所以运行良好,但我强烈需要.NET的.dll。

启动命令时:

ikvm -jar mylib.jar

一切都是好的(我也尝试了一个主文件,以确定:它可以工作)。

但是,当我键入:

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
<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>

共有1个答案

左丘宜然
2023-03-14

只需删除所有与最新版本的方法和类相关的代码,并将其改为java的低版本库,就可以工作了,因为我有类似的错误

 类似资料:
  • 我对我们的可执行文件有问题。我正在Windows ;7 64位开发盒上运行这个C++32位可执行文件,该开发盒还包含所有Microsoft应用程序(Visual Studio 2008+2010、TFS、SDK、Microsoft Office)...它还运行得很好。 现在,我得到了相同程序的客户端安装,并被要求使用干净的Windows ;7安装来测试它。因此,我得到了一个Windows ;7 6

  • 本文向大家介绍windows下使用Xshell时出现丢失msvcr110.dll等dll问题,包括了windows下使用Xshell时出现丢失msvcr110.dll等dll问题的使用技巧和注意事项,需要的朋友参考一下 启动程序报错如下:无法启动此程序,因为计算机中丢失MSVCR110.dll。尝试重新安装该程序以解决此问题。应该很容易就搜索到,缺少这样的dll文件,是没有安装Visual C++

  • 我的php_统计。dll始终提供 在Apache错误日志中。 我在Windows 10 64位机器中设置了XAMPP 32位。带有XAMPP的PHP(也是32位,上周下载的最新版本)。 由于Windows安全PHP_不得不安装到D驱动器stats.dll-所有版本从1.0.5到2.0.3,所有32位,非线程安全和线程安全再次尝试下载上周(是的,我也尝试了64位版本) php_统计。dll位于D:/

  • 本文向大家介绍cython 包装DLL:从C ++到Cython到Python,包括了cython 包装DLL:从C ++到Cython到Python的使用技巧和注意事项,需要的朋友参考一下 示例 这展示了一个用Cython包装C ++ dll的简单例子。它将涵盖以下主要步骤: 使用Visual Studio使用C ++创建示例DLL。 用Cython包裹DLL,以便可以在Python中调用它。

  • dll 应该保存在哪里,node 第三方库应该如何封装,有没有最佳实践