473,388 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 8813
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******@myrealbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/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******@myrealbox.com> wrote in message
news:ad******************************@news.teranew 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 <mc******@myrealbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/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******@myrealbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/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
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...
1
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...
1
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...
2
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
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...
2
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(...
3
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...
0
by: ab | last post by:
Hi, can anybody know how can I load and display large JPG files in J2ME? best regards ab
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.