Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified
Accepted Solution

Logarithmic Function in MathUtilities - Unsatisfied Link Error

Hi,

 

I am using Blackberry Java 4.7 environment and needed to calculate log of a double value. I tried using MathUtilities.log(logBase), where logBase is a double value but on execution of this line, I get the following exception:

 

Exception in thread "main" java.lang.UnsatisfiedLinkError: net.rim.device.api.util.MathUtilities.log(D)D 

 

I tried to google around but could not find a satisfactory answer. I'd be really grateful if some one could please provide some insight on this. Looking at the API outline of MathUtilities source code{in eclipse}, it seems that this has to do something with the native libraries which could mean that some of the libraries might be missing, but from where they are missing and how could it be fixed - I have no idea Smiley Sad

 

Could anyone please spend a few seconds on this and help me out. I will be greatly thankful.

 

Thanks in advance.

 Regards.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

Are you executing on the 4.7 simulator, or on a device?

 

If device, what device and OS level?

 

 

Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

I have not run the code on a device or simulator yet. I am simply running it as a Java application but I do intend to run this on Blackberry Storm which runs on BB JVM 4.7.
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

This is the first post I've seen where the poster is trying to run RIM code as a desktop application.

 

Can you explain what you are trying to accomplish?

 

 

Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

well, how would running the application on desktop matter in this case? I mean for testing purposes only, there might be times when you dont have the need of running the application on simulator all the time. It happens all the time, I dont know what your experience is, but for example sake, in web apps, you do not always put your files on a domain server, only to test the application. You do that on a local server.

 

Similarly, you do not put your apps on a device straight away, you test it on a simulator, and the same analogy applies here. I dont think that running a RIM application as a desktop app would demean its purpose. I would really appreciate if you could provide some useful insights on this issue, instead of criticising.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

OK, then why not run on the simulator? 

 

BB is based on Java ME, not Java SE. BB is based on a proprietary kvm and libraries. I think you are wasting your time trying to run as a desktop app - use the tools that are provided (like the simulator).

 

Of course, that's just my opinion, I may be wrong.  Smiley Happy

 

 

Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

you might be absolutely right and I am definitely going to try this out on a simulator now. And if it works then it would then become the matter of running it on desktop just to find out the reason of not working.
Highlighted
Developer
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

Classes under net.rim.... are provided by the aptly named net_rim_api.jar that you find under the 'lib' folder in your JDE install.

If you add said jar to your J2ME project in just about any IDE the project will compile. However, most methods in that jar are BlackBerry 'native' and they will not execute on the desktop.

 

Cheers, Barak.

Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

Thanks bneeman, the information looks pretty useful and more appropriate. Thanks again for your help.
Developer
Posts: 39
Registered: ‎03-24-2009
My Device: Not Specified

Re: Logarithmic Function in MathUtilities - Unsatisfied Link Error

The project does compile indeed as Eclipse takes care of classpaths, but just for my info, any idea about the jars which may have implementation code for these native methods?