473,545 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

J2ME: How to load external library?

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.
Jul 17 '05 #1
3 8824
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 <mc******@myrea lbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.ne t/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

Jul 17 '05 #2
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" <mc******@myrea lbox.com> wrote in message
news:ad******** *************** *******@news.te ranews.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 <mc******@myrea lbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.ne t/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

Jul 17 '05 #3
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 <mc******@myrea lbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.ne t/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2273
by: Dave Rathnow | last post by:
We are looking at using J2ME in a embedded device that will be deployed in an industrial application and I've been doing some research to see how practical J2ME would be for our application. Most of the devices I've come across that use J2ME are consumer devices like phones and PDAs. I would be interested in hearing from anyone who might be...
1
3548
by: Ralph Yozzo | last post by:
Hi, Does anyone know of a good place to look for a starting point -- I'm building an application on J2ME and I want to have a scripting language to both access my UI and the database RMS. Most phones have very limited resources so the interpreter should be small and fast. Does anyone know of a simple scripting language source to handle if...
1
2932
by: David A. Osborn | last post by:
Can somebody point me in the right direction for writing a program in j2me for a portable device that syncs data with an application on a desktop computer? I realize this is a fairly vague question, but I can't see it find much for a tutorial or howto on the web. Thanks!
2
5302
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on...
1
1447
by: dhirajnambiar | last post by:
Hi everyone... Please help me out with this, as i have a load of work to do within about 10 days Is there any way i can invoke PHP pages on my webserver ? I have used Apache as the webserver... I want to know, how can i "post" variables into a php pages... for eg : one of my php pages uses a variable $_POST
2
3355
by: mayankcdac | last post by:
Hi i am a new guy in j2me field i am working in j2me gaming but i want to switch from gaming to application. i am facing some problems to build j2me application can any one give me any source code( any application of j2me which is complete) for study my email: <deleted>
3
2310
by: jaxx0rr | last post by:
This will probably look like a really stupid piece of code.. but it works My question is, how can I write the last part so there is only one extended Canvas class that can recieve a parameter for the image number Thanks import java.io.IOException; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Command; import...
0
2290
by: ab | last post by:
Hi, can anybody know how can I load and display large JPG files in J2ME? best regards ab
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.