Gephi的Java默认方法未使用ikvm-from dll库在C#中实现 [英] Gephi's java default method not implemented in C# with an ikvm-from dll library

查看:143
本文介绍了Gephi的Java默认方法未使用ikvm-from dll库在C#中实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Java的了解很少,所以我可能误解了我的问题:

I have very few knowledges in java so I maybe misunderstood my problem:

我正在使用Java中的Gephi API,并且我使用IKVMC在dll上进行工作.

I'm working on the Gephi API which is in Java, and I used IKVMC to work on a dll.

我尝试按照Gephi文档中的说明创建一个空图https://github.com/gephi/gephi/wiki/How-to-manipulate-Graph

I tried to create an empty graph as explained here in the Gephi doc https://github.com/gephi/gephi/wiki/How-to-manipulate-Graph

在C#中,我尝试过:

ProjectController pc;
            pc = (ProjectController)org.openide.util.Lookup.getDefault().lookup(typeof(ProjectController));

在第二行,我收到以下错误:

At the second line I get the following error:

非异常:System.TypeLoadException:Laméthode'thenComparing'du ty pe'org.openide.util.lookup.ALPairComparator'de l'assembly'gephi-toolkit,Vers ion = 0.0.0.0,文化=中性,PublicKeyToken =无效. àorg.openide.util.lookup.AbstractLookup.getPairsAsLHS() àorg.openide.util.lookup.MetaInfServicesLookup.beforeLookup(Template) àorg.openide.util.lookup.AbstractLookup.lookupItem(模板模板) àorg.openide.util.lookup.AbstractLookup.lookup(Class clazz) àorg.openide.util.Lookup.getDefault() àmyproject ....

Exception non gérée : System.TypeLoadException: La méthode 'thenComparing' du ty pe 'org.openide.util.lookup.ALPairComparator' de l'assembly 'gephi-toolkit, Vers ion=0.0.0.0, Culture=neutral, PublicKeyToken=null' n'a pas d'implémentation. à org.openide.util.lookup.AbstractLookup.getPairsAsLHS() à org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(Template ) à org.openide.util.lookup.AbstractLookup.lookupItem(Template template) à org.openide.util.lookup.AbstractLookup.lookup(Class clazz) à org.openide.util.Lookup.getDefault() à myproject ....

用英语很快就说出org.openide.util.lookup.ALPairComparator类型的thenComparing()方法没有实现.

我进行了一些研究,并在反编译的dll中,错误似乎在这里

I made some researches and in the decompiled dll, the error seems to be here

internal LinkedHashSet getPairsAsLHS()
    {
        AbstractLookup.Storage storage = this.enterStorage();
        LinkedHashSet result;
        try
        {
            Enumeration enumeration = storage.lookup(ClassLiteral<Object>.Value);
            TreeSet.__<clinit>();
            TreeSet treeSet = new TreeSet(ALPairComparator.DEFAULT);

我发现thenComparing是一个默认"方法,在Java 8中,如果我没有说错的话,默认方法已经实现.

I found that thenComparing is a "default" method and in java 8, the default methods are already implemented if I don't say a mistake.

我的项目引用了IKVM的java.util库.

My project has reference to IKVM's java.util library.

因此,可能是一个问题,即ikvm在C#中严重支持默认方法的实现,或者那么Comparing严重支持内部ALPairComparator类型.

So maybe it's a problem that the implementation of default methods is badly supported in C# with ikvm or that thenComparing badly support the type internal ALPairComparator.

由于我一直不太了解它的来源,因此欢迎提供任何线索.如果您有任何疑问或需要更高的精确度,请问我.

Sincerely I have not much idea of where it could come from, so any clue would be welcomed. If you have any questions or need more precisions, ask me.

谢谢您的帮助.

我注意到Gephi与Java 1.8不兼容,但与Java 1.7不兼容

I notice that Gephi isnot compatible with java 1.8 but with java 1.7

我正在尝试使用IlSpy将dll中的org.openide.util软件包替换为Java 1.7上的以前版本

I'm trying to replace the org.openide.util packages in my dll with a former version on java 1.7 with IlSpy

推荐答案

我解决了.

似乎是Gephi,它与Java 8不兼容,所以我使用了针对Java 7的IKVM 7版本系列(可在nuget获得).

It seems to be Gephi which is not compatible with java 8, so I used IKVM 7 versions serie for java 7 (avaible at nuget).

我在IKVM 7.2和7.4之间遇到一些问题,它想在我有7.2的同时加载7.4.

I had some problems between IKVM 7.2 and 7.4, it wanted to load 7.4 while I had 7.2.

最后,我使IKVM 7.2的dll在sourceforge上可用(具有Windows到Java 7文件夹的Windows环境路径),并且在Visual Studio项目的引用中使用了nuget的IKVM 7.4.

Finally I made my dll with IKVM 7.2 avaible on sourceforge (with my Windows environement path to a java 7 folder) and I used nuget's IKVM 7.4 in my Visual Studio project's references.

似乎正常工作.

这篇关于Gephi的Java默认方法未使用ikvm-from dll库在C#中实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆