-2

dllからネイティブコードを呼び出す静的関数を持つクラスを実装するJarファイルがあります。jarをclasspachに追加しました。私は瓶の中のクラスを見ていますが、それは次のようになります:

package com.aeroflex.afApplicationControlDll;

import com.aeroflex.jni.*;

public class afApplicationControl
{
    static
    {
        System.loadLibrary("afApplicationControlJNI");
    }
    public static native int GetServerVersion (int version[]);
    public static native int Initialise( int n1, int n2, int n3, int n4 );
}

私のクラスでは、クラスafApplicationControlを使用しようとしています

インポートしようとしています:

import com.aeroflex.afApplicationControlDll.*;

しかし、コンパイラは com.aeroflex.* を見つけられませんでした。

何が問題ですか?

4

1 に答える 1

0

jar ファイルがクラスパスにあることを確認してください。プロジェクトを右クリック>プロパティ> Libで、jarがそこに存在することを確認します。その場合は、プロジェクトを選択して「プロジェクト」タブをクリックし、プロジェクトをクリーンアップしてから、プロジェクトをクリーンアップしてください。

于 2013-03-18T08:58:52.087 に答える