Ticket #14200

Native library `wcepeer' not found
Open Date: 2008-12-03 17:43 Last Update: 2018-06-07 18:19

Open [Owner assigned]
5 - Medium
5 - Medium



I am developing a quite simple application for a ATID pocket PC with Windows CE 5.00 and 128 Mb.

The applications consists of a simple frame with some basic components. When Mysaifu tries to paint the frame it causes a 'Exception in thread "Thread-1" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.wce.WCEToolkit' because the JVM does not find the wcepeer library'.

I can assure you that that library exists and is on the correct path (just take a look to the code I give you).

You can find the source code and all the details about the error here:

// -------------- PROGRAM OUTPUT ----------------------

\Program Files\Mysaifu JVM\jre\bin null wcepeer.dll exists. Exception in thread "Thread-1" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.wce.WCEToolkit

at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:607) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:103) at java.awt.Window.<init>(Window.java:133) at java.awt.Frame.<init>(Frame.java:246) at java.awt.Frame.<init>(Frame.java:234) at vista.Vista.<init>(Unknown source) at vista.Vista.main(Unknown source) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:356) at java.lang.VMMainThread$1.run(VMMainThread.java) at java.lang.VMThread.run(VMThread.java:120)

Caused by: java.lang.ExceptionInInitializerError

at java.lang.VMClassLoader.loadClass(Native Method) at java.lang.ClassLoader.loadClass(ClassLoader.java:328) at java.lang.ClassLoader$1.loadClass(ClassLoader.java:1112) at java.lang.ClassLoader.loadClass(ClassLoader.java:293) at java.lang.VMClass.forName(Native Method) at java.lang.Class.forName(Class.java:233) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:583) ...10 more

Caused by: java.lang.UnsatisfiedLinkError: Native library wcepeer' not found (as file wcepeer') in gnu.classpath.boot.library.path and java.library.path

at java.lang.Runtime.loadLibrary(Runtime.java:763) at java.lang.System.loadLibrary(System.java:662) at gnu.java.awt.peer.wce.WCEToolkit.<clinit>(WCEToolkit.java) at java.lang.VMClassLoader.loadClass(Native Method) ...16 more

JVM exit

//----------------- SOURCE -----------------------------

package vista;

import java.awt.Frame; import java.awt.Rectangle; import java.awt.Label; import java.awt.TextField; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.awt.Button; import java.io.File;

public class Vista extends Frame {

private static final long serialVersionUID = 1L; private Label label = null; private TextField textField = null; private TextArea textArea = null; private Button button = null; /** * This method initializes textField * * @return java.awt.TextField */ private TextField getTextField() { if (textField == null) { textField = new TextField(); textField.setBounds(new Rectangle(28, 61, 174, 23)); textField.setText("Campo de texto"); } return textField; }

/** * This method initializes textArea * * @return java.awt.TextArea */ private TextArea getTextArea() { if (textArea == null) { textArea = new TextArea(); textArea.setBounds(new Rectangle(28, 89, 171, 41)); textArea.setText("Campo de texto"); } return textArea; }

/** * This method initializes button * * @return java.awt.Button */ private Button getButton() { if (button == null) { button = new Button(); button.setBounds(new Rectangle(228, 61, 53, 23)); button.setLabel("Cerrar"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { System.exit(0); } }); } return button; }

/** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(System.getProperty("java.library.path")); System.out.println(System.getProperty("gnu.classpath.boot.library.path")); File file = new File(System.getProperty("java.library.path") + File.separatorChar + "wcepeer.dll"); if(file.exists()){ System.out.println("wcepeer.dll exists."); }else{ System.out.println("wcepeer.dll doesn't exists!!"); } new Vista(); }

/** * This is the default constructor */ public Vista() { super(); initialize(); setVisible(true); addWindowListener(new WindowListener() { @Override public void windowOpened(WindowEvent e) { // TODO Auto-generated method stub } @Override public void windowIconified(WindowEvent e) { // TODO Auto-generated method stub } @Override public void windowDeiconified(WindowEvent e) { // TODO Auto-generated method stub } @Override public void windowDeactivated(WindowEvent e) { // TODO Auto-generated method stub } @Override public void windowClosing(WindowEvent e) { // TODO Auto-generated method stub } @Override public void windowClosed(WindowEvent e) { // TODO Auto-generated method stub System.exit(0); } @Override public void windowActivated(WindowEvent e) { // TODO Auto-generated method stub } }); }

/** * This method initializes this * * @return void */ private void initialize() { label = new Label(); label.setBounds(new Rectangle(25, 36, 173, 23)); label.setText("Label de prueba"); this.setLayout(null); this.setSize(298, 296); this.setTitle("Frame");

this.add(label, null); this.add(getTextField(), null); this.add(getTextArea(), null); this.add(getButton(), null); }

} // @jve:decl-index=0:visual-constraint="10,1

//------------- ANT FILE ----------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <project name="Frame" basedir="." default="jar">

<property name="src.dir" value="src"/> <property name="lib.dir" value="lib"/> <property name="build.dir" value="build"/> <property name="launch.dir" value="launch"/> <property name="manifest.name" value="mainClass.txt"/> <property name="mainclass" value="vista.Vista"/> <property name="MainClassTxt" value="Main-Class: "/>
<target name="clean" description="Borrar los ficheros">
<delete dir="build" failonerror="false"/> <delete dir="${launch.dir}" failonerror="false"/>
<target name="compile" depends="clean">
<mkdir dir="${build.dir}"/> <javac encoding="ISO-8859-1" srcdir="${src.dir}" destdir="${build.dir}"/>
<target name="jar" description="Crear jar" depends="clean, compile"> <mkdir dir="${launch.dir}"/>
<manifest file="${manifest.name}">

<attribute name="Main-Class" value="${mainclass}"/> <attribute name="Class-Path" value="${manifest.classpath}"/> </manifest>

<jar destfile="${launch.dir}/${ant.project.name}.jar" basedir="${build.dir}" manifest="${manifest.name}"/> </target>


Please, do not hesitate to ask me if you need help.

Thank you, Miguel.

Ticket History (3/10 Histories)

2008-12-03 17:43 Updated by: miguel
  • New Ticket "Native library wcepeer' not found " created
2009-03-23 23:55 Updated by: evgen28

I'm also have this problem and didn't find anywhere how to solve...

2009-08-04 21:03 Updated by: fpavo

Same problem here, with 0.4.5 version. AWT and swing libraries are not working, I'm blocked!!!!

Any workaround?

2009-09-11 12:43 Updated by: petitk

I think this problem is about the file 「wcepeer.dll」 try to System.loadLibrary("wcepeer"); it's output is : java.lang.UnsatisfiedLinkError: Native library wcepeer' not found (as file wcepeer') in gnu.classpath.boot.library.path and java.library.path but try the another file in the same dir : System.loadLibrary("wcesound"); without throw Exception

My environment is mysaifu 0.4.5 + WinCE 5.0/6.0 this problem's discussion only see after 0.4.5 release cound I get the file 「wcepeer.dll」 in any early version ?

2009-09-22 22:26 Updated by: freebeans
  • Resolution Update from None to Accepted

Mysaifu JVM uses some Windows Mobile specific APIs. (SHLoadImageFile() etc.) I think this is a cause of the problem. Windows CE device cannot load the DLL. I don't know how to port Windows Mobile specific DLL to Windows CE device.

2010-02-13 09:32 Updated by: jlmoya
(This comment has been deleted)
2010-02-13 09:33 Updated by: jlmoya

The same is happening with version 0.4.7 and am using WinCE 5.0. Is there a workaround? Can't create any window/form so this is a show stopper. Any suggestions?

2013-03-20 15:40 Updated by: jerrychang

the Mysaifu JVM has been installed on my PDA with Windows CE 5.00 ,but my java applications can not run on my PDA at all ? this same problem arises.Some one give a suggestion?

2018-06-07 18:18 Updated by: hanafi_othman


It's been 10 years since this was posted.

Today I'm having the same problem. Have anyone got a solution for this?

2018-06-07 18:19 Updated by: hanafi_othman

Répondre à hanafi_othman

Hello, It's been 10 years since this was posted. Today I'm having the same problem. Have anyone got a solution for this?

I'm using the latest version of Mysaifu (0.4.8)

Attachment File List

No attachments


Please login to add comment to this ticket » Login