我正在嘗試使用JNA與javaME 8.2,但沒有成功。我對JNA和javaME都很陌生。 我目前使用的是NetBeans 8.1,javaME SDK 8.2和JNA 4.2.1。JNA和javaME錯誤
我有一個剛創建IntByReference JNA類型的實例以下非常簡單的測試應用程序:
import javax.microedition.midlet.MIDlet;
import com.sun.jna.ptr.IntByReference;
public class JavaMEApplication2 extends MIDlet {
boolean bFirst = false;
boolean loopFlag = true;
//@Override
public void startApp() {
if (bFirst = false) {
try {
// Perform startup operations
} catch (Exception ex) {
ex.printStackTrace();
return;
}
bFirst = true;
} else {
System.out.println("Trying starting IMlet...");
IntByReference data = new IntByReference();
System.out.println("IMlet Demo is already started...");
}
// Start program here
}
代碼編譯沒有錯誤,但是當我嘗試在模擬器中執行它(I」 m使用與SDK一起安裝的默認EmbeddedDevice仿真器)我得到以下錯誤。
Starting emulator in execution mode
Trying starting IMlet...
TRACE: <at java.lang.UnsupportedClassVersionError>, startApp threw an Exception
java.lang.UnsupportedClassVersionError
- javameapplication2/JavaMEApplication2.startApp(JavaMEApplication2.java:38)
- .unknown...unknown.(), bci=1
- .unknown...unknown.(), bci=5
- .unknown...unknown.(), bci=236
- .unknown...unknown.(), bci=38
- .unknown...unknown.(), bci=5
- .unknown...unknown.(), bci=127
- com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
java.lang.UnsupportedClassVersionError
- javameapplication2/JavaMEApplication2.startApp(JavaMEApplication2.java:38)
- .unknown...unknown.(), bci=1
- .unknown...unknown.(), bci=5
- .unknown...unknown.(), bci=236
- .unknown...unknown.(), bci=38
- .unknown...unknown.(), bci=5
- .unknown...unknown.(), bci=127
- com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26
BUILD SUCCESSFUL (total time: 8 seconds)
我知道你當你編譯一個JDK比用於執行一個更近的一類java.lang.UnsupportedClassVersionError錯誤,但這不應該是這樣的。
有沒有人有關於這裏發生了什麼的想法?