Hello

My project setting is 1.3 compliance.

Jean-Pierre

-----Message d'origine-----
De : Markus Sinner [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 juin 2007 21:58
À : Jean-Pierre PLANAS
Cc : [email protected]
Objet : Re: [Eclipseme-users] Problem adding external jars to my application

Hello,

i had a problem similar to this when a project was not compiled using 
1.3 compliance. On the project-settings-page under Java-Compiler there 
you can see, which compliance level is choosen.

Could you try that?

Greetings,
Markus

Jean-Pierre PLANAS schrieb:
> Hello
> 
> Ok, I will explain my problem again from the beginning:
> I have 2 projects: A and B.
> B uses classes from A.
> 
> What is not working:
> - When I run (or debug) B from eclipse.
> 
> What is working:
> - When I run B from my phone.
> - When I copy B.jar in java directory of my emulator and run it from my
> emulator.
> 
> The error is: "Uncaught exception java/lang/NoClassDefFoundError".
> 
> Softs are:
> - Eclipse : 3.2.2
> - EclipseME : 1.6.8
> - Sdk : S40_SDK_3rd_Edition_Feature_Pack_1 from Nokia
> 
> Step to reproduce:
> --------------- begin  Step to reproduce -----------------
>   File / New / Other / J2ME Midlet Suite
>     Project Name : "A"
>     Finish
>   File / New / Class
>     Package : "pkA"
>     Name : "classA"
>     Finish.
>   Here the code of the classA :
>     package pkA;
>     public class classA {
>       public static String GetInfoA()
>       {
>               return "GetInfoA";      
>       }
>     }
>   Right click on project A in package explorer / J2ME / Create Package
>   
>   File / New / Other / J2ME Midlet Suite
>     Project Name : "B"
>     Finish
>   File / New / Other / J2ME Midlet
>     Package : ""
>     Name : "classB"
>     Finish.
>   Project / Propreties / Java Build Path / Libraries / Add external jars
>     File : A/deployed/A.jar
>     Order and Export / Check the checkbox for A.jar Here  interesting code
> of ClassB:
>       public void ShowMessage(String aTitre, String aAlertText, 
>         AlertType aAlertType)
>       {
>         // Création de la boite de dialogue " Alert "
>         Alert myAlert = new Alert(aTitre, aAlertText, null, aAlertType);
>         // Affichage de la boite de dialogue
>         Display.getDisplay(this).setCurrent(myAlert);
>       }
>       
>       protected void startApp() throws MIDletStateChangeException {
>               String s = 'A'+classA.GetInfoA();
>                 ShowMessage(s,s,AlertType.INFO);              
>   
>       }
>   Right click on project B in package explorer / J2ME / Create Package
Right
> click on project B in package explorer / Run as / Run
>     Right click on Wireless Toolkit Emulator / New
>       Name : "ConfigB"
>       Midlet : "classB"
>       Apply / Run
>   
>   And now I have the exception :
>   Uncaught exception java/lang/NoClassDefFoundError: pkA/classA
> --------------- end Step to reproduce -----------------
> 
> Thanks for advance for your help
> 
> Jean-Pierre
> 
> 
> 
> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] De la part de Craig
> Setera
> Envoyé : jeudi 14 juin 2007 03:53
> À : [email protected]
> Objet : Re: [Eclipseme-users] Problem adding external jars to my
application
> 
> If you do not select "export" from the Order and Export page, the 
> classes from that jar will not be added to the deployed jar file. At 
> this point, I'm a bit confused about where you are at with this problem. 
> Can you please start from the beginning again and describe what you are 
> doing and what has or has not worked for you?
> 
> Jean-Pierre PLANAS wrote:
>> Hello
>>
>> I am sorry, I make a mistake on some informations:
>>
>> On real device B Midlet runs ok.
>>
>> And when I take B.jar, and I put it on predefjava/predefcollections 
>> directory of my emulator, B.jar runs well without exceptions.
>>
>> Sorry about this mistake.
>>
>> But, when I run directly from eclipse, I have always the same problem.
>>
>> When I run from eclipse, it create a new directory 
>> c:\windows\temp\ueiemulatorXXXX witch contains 3 files :
>>
>> - classB.jar,
>>
>> - classB.jad
>>
>> - META-INF\MANIFEST.MF
>>
>> When I unjar classB.jar, I don’t see any trace of classA.
>>
>> I see in console window this information :
>>
>> UEIInvocationParameters: About to call 
>>
>
FileUtils.createFakeJadAndJar(classname=classBclasspath=C:\Java\B\verified\l
> ibs\A.jar;C:\Java\B\verified\classes)
>> The file “C:\Java\B\verified\libs\A.jar” exists, no problem…
>>
>> About what you said “export the external jar (in your build 
>> path->order and export)” and “add it to the build path”, I don’t 
>> understand well the difference.
>>
>> What I made is :
>>
>> Project / Properties / Java Build Path / Libraries / Add external jars
>> File : A/deployed/A.jar
>> Order and Export / Check the checkbox for A.jar
>>
>> Thanks for advance for your help…
>>
>> Jean-Pierre
>>
>> ------------------------------------------------------------------------
>>
>> *De :* [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] *De la part de* 
>> tzur Sayag
>> *Envoyé :* samedi 9 juin 2007 18:47
>> *À :* Jean-Pierre PLANAS
>> *Cc :* [email protected]
>> *Objet :* Re: [Eclipseme-users] Problem adding external jars to my 
>> application
>>
>> I'm not that much of a configuration guy but I'm using a external jars 
>> (kxml for exmaple) in my applications, one thing
>> that gives that NoClassFound error is when you forget to export the 
>> external jar (in your build path->order and export) mark it so
>> that it gets deployed to the phone,
>> the one other thing is that after you've added the jar to your project 
>> you have to add it to the build path, but I guess that's obvious.
>> hope this helps a bit,
>> --tzurs
>>
>> On 6/9/07, *Jean-Pierre PLANAS* <[EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>> wrote:
>>
>> Hello
>>
>> I have the same problem on the emulator and the real phone.
>>
>> The "not found" class is the class of the external jar.
>>
>> I have the same problem (exception when running NoClassDefFoundError) 
>> when I
>> add the external project in the Project tab.
>>
>> The steps to reproduce my problem:
>>
>> File / New / Other / J2ME Midlet Suite
>> Project Name : "A"
>> Finish
>> File / New / Class
>> Package : "pkA"
>> Name : "classA"
>> Finish.
>> Here the code of the classA :
>> package pkA;
>> public class classA {
>> public static String GetInfoA()
>> {
>> return "GetInfoA";
>> }
>> }
>> Right click on project A in package explorer / J2ME / Create Package
>>
>> File / New / Other / J2ME Midlet Suite
>> Project Name : "B"
>> Finish
>> File / New / Other / J2ME Midlet
>> Package : ""
>> Name : "classB"
>> Finish.
>> Project / Propreties / Java Build Path / Libraries / Add external jars
>> File : A/deployed/A.jar
>> Order and Export / Check the checkbox for A.jar
>> Here interesting code of ClassB:
>> public void ShowMessage(String aTitre, String aAlertText,
>> AlertType aAlertType)
>> {
>> // Création de la boite de dialogue « Alert »
>> Alert myAlert = new Alert(aTitre, aAlertText, null, aAlertType);
>> // Affichage de la boite de dialogue
>> Display.getDisplay(this).setCurrent(myAlert);
>> }
>>
>> protected void startApp() throws MIDletStateChangeException {
>> String s = 'A'+classA.GetInfoA();
>> ShowMessage(s,s,AlertType.INFO);
>>
>> }
>> Right click on project B in package explorer / J2ME / Create Package
>> Right click on project B in package explorer / Run as / Run
>> Right click on Wireless Toolkit Emulator / New
>> Name : "ConfigB"
>> Midlet : "classB"
>> Apply / Run
>>
>> And now I have the exception :
>> Uncaught exception java/lang/NoClassDefFoundError: pkA/classA
>>
>> Someone could tell me what I forget or I am doing wrong ?
>>
>> For information, I have :
>> Eclipse : 3.2.2
>> EclipseME : 1.6.8
>> Sdk : S40_SDK_3rd_Edition_Feature_Pack_1.
>>
>> When I unjar B.jar, I have the following files :
>> - pkA/classA.class
>> - classB.class
>> - META-INF/MANIFEST.MF
>>
>> Thanks for advance.
>>
>> Jean-Pierre
>>
>> -----Message d'origine-----
>> De: [EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>
>> [mailto: [EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>] De la part de 
>> Markus
>> Sinner
>> Envoyé: samedi 9 juin 2007 11:14
>> À: Jean-Pierre PLANAS
>> Cc: [email protected] 
>> <mailto:[email protected]>
>> Objet: Re: [Eclipseme-users] Problem adding external jars to my 
>> application
>>
>> Hello,
>>
>> i do not think that the JAR must be named in the Manifest. Eclipse just
>> adds the files contained in the external JAR to the newly deployed JAR.
>>
>> Where are you running your Midlet? On the emulator or on a real phone?
>> Maybe you should use try{} catch(Error err) in your startApp()-Method to
>> trace the Error and find out, which class was not found.
>>
>> Did you try not to include the external JAR but the whole Project? In
>> the Projekt-Properties you can add that with the Projects tab. Then you
>> should receive a error if one class is missing.
>>
>> Regards,
>> Markus
>>
>> Jean-Pierre PLANAS schrieb:
>>> Hello
>>>
>>>
>>>
>>> I have the same problem that the following thread :
>>>
>>> I use eclipseME 1.6.8 with eclipse 3.2.2 and jdk 6u1.
>>>
>>>
>>>
>>> I have created 2 projects (A and B).
>>>
>>> Package of project A is used in project B.
>>>
>>> In project B, I setup the use of en external jar file from A project. I
>>> have checked the checkbox in tab "Order and export"…
>>>
>>>
>>>
>>> When I run application B, I have "Uncaught exception
>>> java/lang/NoClassDefFoundError"
>>>
>>> When I unjar B.jar file, I see :
>>>
>>> - The class is contained in my B.jar file…
>>>
>>> - There is no reference to A in Manifest.mf.
>>>
>>>
>>>
>>> I don't understand why.
>>>
>>> If someone know the solution, could you explain me please ?
>>>
>>>
>>>
>>> How is generated the file Manifest.mf ?
>>>
>>>
>>>
>>> Jean-Pierre
>>>
>>>
>>>
>>>> Hi Craig,
>>>> thanx for reply..... well, yes and no.. i kept on having different
>> errors
>>>> (java/lang/Verify).. so i moved the external classes in my j2me (it was
>>>> still one of my packages..so i had access to sources...).
>>>> i will re-try it again as soon as my app is finished...
>>>> thanks and regards
>>>> Marco
>>>> On 11/19/06, Craig Setera <[EMAIL PROTECTED]> wrote:
>>>>> Marco,
>>>>> This sounds odd. Have you had any luck getting this going since you
>>>>> wrote this?
>>>>> Craig
>>>>> Marco Mistroni wrote:
>>>>>> Hi all,
>>>>>> i am using eclipseME to develop J2ME applications./
>>>>>> I have used J2ME before, and in the past it was enough to put
>> external
>>>>>> jar libraries in the lib directory of your J2ME application.
>>>>>> Now, i am using EclipseME to compile/preverify/package my j2me
>>>>>> application, and when the application runs i get
>>>>>> Uncaught exception java/lang/NoClassDefFoundError:
>>>>>> com/mm/j2me/core/ApplicationException.
>>>>>> That class is contained in myjar1.jar,, which is contianed in the
>> lib
>>>>>> directory of my j2me application.
>>>>>> In EclplseME, i have selecte din Properties/Java Build Path
>>>>>> myjar1.jar as an External library, and i have marked the checkbox
>> next
>>>>>> to it in 'Order and Export' tab.
>>>>>> when i compile app using EclipseME, i can see myjar1.jar in the
>>>>>> verified\libs.
>>>>>> I still could not understand why the app was not finding the class,
>>>>>> everything seemed in order.
>>>>>> So, i tried to unjar my j2me jar of the bin directory..the
>>>>>> Manifest.mf was not referrencing any external jars..
>>>>>> i still can't figure out why i keep on getting ClassNotFound
>>>>>> exception.....
>>>>>> can anyone help me out?
>>>>>> thanks in advance and regards
>>>>>> Marco
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
> ------------------------------------------------------------------------- 
>>> This SF.net email is sponsored by DB2 Express
>>> Download DB2 Express C - the FREE version of DB2 express and take
>>> control of your XML. No limits. Just data. Click to get it now.
>>> http://sourceforge.net/powerbar/db2/
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Eclipseme-users mailing list
>>> [email protected] 
>> <mailto:[email protected]>
>>> https://lists.sourceforge.net/lists/listinfo/eclipseme-users 
>> <https://lists.sourceforge.net/lists/listinfo/eclipseme-users>
>>
>> --
>>
>> *********************************
>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>> http://www.psitronic.de
>>
>> psitronic IT-Solutions
>> Markus Sinner
>> W-Rathenau-Str. 14 - 68642 Bürstadt
>> Tel.: (+49)6206 / 963513
>> Fax: (+49)6206 / 963514
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/ 
>> <http://sourceforge.net/powerbar/db2/>
>> _______________________________________________
>> Eclipseme-users mailing list
>> [email protected] 
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/eclipseme-users
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Eclipseme-users mailing list
>> [email protected] 
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/eclipseme-users 
>> <https://lists.sourceforge.net/lists/listinfo/eclipseme-users>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Eclipseme-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/eclipseme-users
>>   
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Eclipseme-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/eclipseme-users
>  
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Eclipseme-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/eclipseme-users

-- 

*********************************
[EMAIL PROTECTED]
http://www.psitronic.de

psitronic IT-Solutions
Markus Sinner
W-Rathenau-Str. 14 - 68642 Bürstadt
Tel.: (+49)6206 / 963513
Fax:  (+49)6206 / 963514
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Eclipseme-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/eclipseme-users

Reply via email to