views:

65

answers:

1

Hi.

I am a newbie at J2ME. Recently, I've shifted from Netbeans to Eclipse because of some internal constraints. I am making an App which makes use of a user-defined library. This library has only a jar file. Now, in Netbeans there were no problems. But in eclipse, I am unable to access the classes defined in the jar file included in my library. The exception thrown is java.lang.NoClassDefFoundError. What should I do?

+1  A: 

Have you added the jar through:

right click your project > Build Path > Configure Build Path > Add External Jars and select your jar from there?

In case the jar is in your project dir, you can use "Add Jars" (not External).

I assume you have done it, so to the next step:

How are you running your application? In the Run Configurations there is a classpath tab - make sure your jar is present there as well.

Bozho
hi...thanks for responding. But it doesnt seem to work.Any other suggestions??
pujakhemka
first answer my question - how are you running your application.
Bozho
I am not really able to understand your question....I go to run configuration, add the midlet name and project source and run it.
pujakhemka
what about right-click your midlet and Run it?With your approach - do you add the library to the classpath tab, as I said in my answer?
Bozho
hmm..i couldnt find any classpath tab, so i added the library in the source tab in run configuration.And tried running via right clicking on the midlet, but in vain
pujakhemka
didn't it work when your right-click your midlet and run it?
Bozho
hi...no ...showed same problem...
pujakhemka
where exactly is the classpath option??
pujakhemka