2011-06-22 112 views
2

我對j2me非常陌生。我創建了一個示例程序,但我無法運行該程序。構建失敗的消息來了。我的代碼是:在netbeans中運行j2me應用程序時出現問題

import javax.microedition.lcdui.*; 
import javax.microedition.midlet.*; 

/** 
* @author aneesh 
*/ 
public class httpconnection extends MIDlet { 
    private Command exit, start; 
    private Display display; 
    private Form form; 
    public httpconnection() 
    { 

    } 
    public void startApp() { 
    display = Display.getDisplay(this); 
    exit = new Command("Exit", Command.EXIT, 1); 
    start = new Command("Start", Command.EXIT, 1); 
    form = new Form("Http Connection"); 
    form.addCommand(exit); 
    form.addCommand(start); 

    display.setCurrent(form); 
    } 

    public void pauseApp() { 
    } 

    public void destroyApp(boolean unconditional) { 
    } 


} 

,我得到的錯誤是

java.lang.UnsatisfiedLinkError: /usr/local/netbeans-7.0/mobility/WTK2.5.2/bin/sublime.so: /usr/local/netbeans-7.0/mobility/WTK2.5.2/bin/sublime.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) 
    at java.lang.ClassLoader$NativeLibrary.load(Native Method) 
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750) 
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646) 
    at java.lang.Runtime.load0(Runtime.java:787) 
    at java.lang.System.load(System.java:1022) 
    at com.sun.kvem.Sublime.<init>(Unknown Source) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532) 
    at java.lang.Class.newInstance0(Class.java:372) 
    at java.lang.Class.newInstance(Class.java:325) 
    at com.sun.kvem.Lime.createLime(Unknown Source) 
    at com.sun.kvem.KVMBridge.<init>(Unknown Source) 
    at com.sun.kvem.KVMBridge.getBridge(Unknown Source) 
    at com.sun.kvem.midp.MIDP.run(Unknown Source) 
    at com.sun.kvem.environment.EmulatorInvoker.runEmulatorImpl(Unknown Source) 
    at com.sun.kvem.environment.EmulatorInvoker.main(Unknown Source) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:616) 
    at com.sun.kvem.environment.JVM.main(Unknown Source) 
NetBeansProjects/VDCustomComponents1/nbproject/build-impl.xml:915: Execution failed with error code 1. 
BUILD FAILED (total time: 3 seconds) 
+0

可能是一個bug ...你可以在netbeans windows版本上試試嗎? – Cris

回答

3

好像你有32位WTK和64位JDK。您應該安裝匹配的32位JDK並設置WTK以使用它。

從Sun(Oracle)網站下載的命令行WTK安裝程序應在安裝期間要求您提供JDK位置。

相關問題