0

I have managed to get the sample projects for the JNI4NET tool working by generating some Java proxy classes with the ProxyGen.exe program supplied with it.

I am now trying to translate this working sample into a small test. So far I have created a simple Java class and compiled it into a Java class library jar file. I have done this in Netbeans using Java 1.7 Platform.

The class is below

public class Person 
{
    public String GetName()
    {
        return "Nobody";
    }
}

The output from ProxyGen simply states

Can't load class Person

Judging by the output I have to assume that ProxyGen has read the jar and recognized the class Person is present but, as it says, "can't load it". Which I am not exactly sure what that means or how its failing.

I feel like I need to supply the .class/.java file to ProxyGen, though this is not done in the sample (which is working). So does this issue possibly have to do with how the jar is compiled? Which again doesn't make sense because as I understand it you can simply unzip jar files to view the source classes?..

Any ideas?

4

1 回答 1

1

也许您的 JAVA_HOME 指向的 JRE 早于 1.7。它由 proxygen.exe 使用。旧的 JVM 无法读取 .class 文件?只是猜测。

于 2016-12-09T09:48:47.540 回答