Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > J2ME: How to load external library?

Reply
Thread Tools

J2ME: How to load external library?

 
 
SpaceCowboy
Guest
Posts: n/a
 
      08-28-2003
To begin, I'm using JBuilder9 under J2ME and MIDP 1.0. I'm trying to use an
external library. I can get my code to compile, but I can't get the library
code working on the emulator.

I'm working on a poker game, and have come quiet far with it. I'm to the
point I need to write a hand evaluation system. As luck would have it, these
guys have a Java open source hand evaluation program already written.

http://spaz.ca/aaron/poker/src/eval.html

So, I download their code, but now I don't know how to get it into my
project. I am using JBuilder, and was able to add the .jar files under
Tools/Configure JDK. I can then import the libraries and the autocompletion
finds it, it compiles correctly, but then when I go to run it on the
emulator (Nokia developer's suite emulator), I get a class not found error.

I know that I need to get this library somehow packed into the .jar/.jad
files that the phone will run, but I don't know how to do this. When I tried
to unpack these files into my src directory, I got it to compile, but then
couldn't get an application created because of pre-verifier errors.

Does anyone have any suggestions on this? I've been stuck for several days
because of this problem and I don't know what to do next.

SpaceCowboy

P.S. Sorry for the cross-post, but I'm having an incredibly difficult time
getting any help to the problems I run into.


 
Reply With Quote
 
 
 
 
Darryl L. Pierce
Guest
Posts: n/a
 
      08-29-2003
SpaceCowboy wrote:
> To begin, I'm using JBuilder9 under J2ME and MIDP 1.0. I'm trying to use an
> external library. I can get my code to compile, but I can't get the library
> code working on the emulator.


<snip>

All code that's used by your MIDlet that's *not* a part of the device
has to be supplied by your MIDlet suite. So, if you're using 3rd party
code, you have to bundle *all* of the code you're using into *your* JAR
file.

--
Darryl L. Pierce <>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

 
Reply With Quote
 
 
 
 
SpaceCowboy
Guest
Posts: n/a
 
      09-02-2003
I'm still relatively new to Java. Would this mean I would need to basically
add the individual files to my project, or is there some way to compile 3rd
party JARs into the JAR for my midlet suite.

SpaceCowboy

"Darryl L. Pierce" <> wrote in message
news: s.com...
> SpaceCowboy wrote:
> > To begin, I'm using JBuilder9 under J2ME and MIDP 1.0. I'm trying to

use an
> > external library. I can get my code to compile, but I can't get the

library
> > code working on the emulator.

>
> <snip>
>
> All code that's used by your MIDlet that's *not* a part of the device
> has to be supplied by your MIDlet suite. So, if you're using 3rd party
> code, you have to bundle *all* of the code you're using into *your* JAR
> file.
>
> --
> Darryl L. Pierce <>
> Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
> "What do you care what other people think, Mr. Feynman?"
>



 
Reply With Quote
 
Darryl L. Pierce
Guest
Posts: n/a
 
      09-02-2003
SpaceCowboy wrote:
> I'm still relatively new to Java. Would this mean I would need to basically
> add the individual files to my project, or is there some way to compile 3rd
> party JARs into the JAR for my midlet suite.


You would have to extract the files out of the 3rd party JAR file and
put them into your own JAR file along with your code/resources.

--
Darryl L. Pierce <>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create references to external scipt files from within an external script file Mellow Crow Javascript 6 11-04-2005 01:16 PM
Unable to load RMI with external classes Ian Java 1 12-21-2004 02:41 AM
unresolved external symbol/using an external dll Scott Allen C++ 8 05-02-2004 06:11 PM
Reasoning for load-external-dtd Xerces default setting? blu4899 XML 4 10-31-2003 08:53 PM
How to load a resource from an external jar Ahmed Moustafa Java 2 08-25-2003 05:50 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57