This discussion is archived
3 Replies Latest reply: Aug 19, 2010 5:25 AM by EJP RSS

jar file exception

843804 Newbie
Currently Being Moderated
I created a jar file for the following java class.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class WMSMS extends JFrame{
     public native void SendSMS(boolean a,boolean b,String SMSC, String phno,String msg);
     static {
          catch (UnsatisfiedLinkError e)
               System.err.println("WMSMS.dll failed to load. \n" + e);
    public WMSMS() {
         JPanel contentpanel=(JPanel)getContentPane(); 
           final JLabel jl=new JLabel("Phone NO:");
           addelement(contentpanel, jl, 10, 20, 100, 20);
           final JTextField jtxt=new JTextField(10);
           addelement(contentpanel, jtxt, 80, 20, 100, 20);
           final JLabel jl2=new JLabel("Message:");
           addelement(contentpanel, jl2, 10, 50, 100, 20);
           final JTextField jtxt2=new JTextField(10);
           addelement(contentpanel, jtxt2, 80, 50, 100, 20);
          JButton btn=new JButton("Submit");
          addelement(contentpanel, btn, 10, 80, 100, 20);
        btn.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent ae) {
       setSize(300, 300);
       setLocation(new Point(150,150));
private void addelement(Container c,Component e,int x,int y,int h,int w){
     e.setBounds(x, y, h, w);
public static void main (String[] args) {
   new WMSMS();
I used the command :
jar cvf WMSMS.jar WMSMS.class
I created a shorcut lnk file using the the command:
*255#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" -Djava.library.path=\Windows "-classpath" "\Program Files\WMSMS\WMSMS.jar" "WMSMS"*
to test the jar file in my windows mobile PDA.
I placed the 'WMSMS.dll' in VC++ under the \Windows folder in the device.But on clicking the link it shows the following exception.

Exception in thread "main" java.lang.UnsupportedClassVersionError: (WMSMS) bad major version at offset=6 at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at Source) at Source) at$ Source) at Source) at Source) at Source)

Isnt this something related to jar file?

Edited by: shreya_ann on Aug 19, 2010 2:30 AM