Skip to main content

BigInteger Problems

6 replies [Last post]
Anonymous

Does anyone know why the BigInteger class would not work in J2ME? I am
trying to use it and everything compiles fine. When I try to run the
program it just hangs. Thank you in advance.

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15

You may be seeing issues related to BigInteger needing java.util.Random and if you use the JAVA SE version of the source Random needs SecureRandom, which requires some sun.security classes. Which are going to have issues running in a CLDC environment.

But the main issue you will find is that you are trying to include a java.* file into your CLDC jar. While this may work on the desktop environment or within the WTK even, when you try to put this on a real phone, it will fail due to a security requirement in JavaME.

This security requirement does not allow you to override any of the internal Java packages. These packages include java.* javax.* sun.* com.sun.*
No Java implementation that passes the TCK should allow your code or jar files to override any of the files in these packages, and this should include inserting classes into these packages that are not already there.

You might be able to place BigInteger into another package and recompile. That might work, but you will have to make sure you do not include any Java SE source that is in any of the above mentioned packages without changing the package to something else, and correcting the imports if needed. Also look for fully qualified class references and make sure they are pointing to the correct package.

Try to use what is provided as much as possible so if you can get away with the Random that CLDC has use it.

I guess the haunting question I have is why do you need BigInteger? :)

Regards,
-Shawn

SUBSCRIBE KVM-INTEREST satyarajasekhar

You can use API provided by bouncycastle to fix your problem. Here is the
link for the bouncycastle API that tells us that bouncycastle API was
modified to fix that BigInteger Problem.

http://www.bouncycastle.org/releasenotes.html

Probably, you won't have any problem, if you download the bouncycastle API,
and import that API instead of the API you are using.

Thanks,
G.S.Rajasekhar

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

김제언(Ruiz)

Dear members
LG open developer network with LG Java SDK support.
http://developer.lgmobile.com/

Thanks

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Joe Bowbeer

BigInteger is not part of CLDC. It should not be found in the javac
bootclasspath that defines your target platform, assuming CLDC is your
target config, and your code should not compile.

On 1/16/08, Padilla, Alex D wrote:
> Does anyone know why the BigInteger class would not work in J2ME? I am
> trying to use it and everything compiles fine. When I try to run the
> program it just hangs. Thank you in advance.
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Padilla, Alex D

Thanks, Joe for the reply. I added BigInteger and some other classes
into the classpath during compilation. Everything compiled fine. The
new classes were added successfully as I can use them in programs I have
created. The only class I added to the CLDC that is giving me problems
is the BigInteger class. Any ideas?

-----Original Message-----
From: A mailing list for KVM discussion
[mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of Joe Bowbeer
Sent: Wednesday, January 16, 2008 1:16 PM
To: KVM-INTEREST@JAVA.SUN.COM
Subject: Re: BigInteger Problems

BigInteger is not part of CLDC. It should not be found in the javac
bootclasspath that defines your target platform, assuming CLDC is your
target config, and your code should not compile.

On 1/16/08, Padilla, Alex D wrote:
> Does anyone know why the BigInteger class would not work in J2ME? I
> am trying to use it and everything compiles fine. When I try to run
> the program it just hangs. Thank you in advance.
>
> ======================================================================
> ===== To unsubscribe, send email to listserv@java.sun.com and include
> in the body of the message "signoff KVM-INTEREST". For general help,
> send email to listserv@java.sun.com and include in the body of the
> message "help".
>

========================================================================
===
To unsubscribe, send email to listserv@java.sun.com and include in the
body of the message "signoff KVM-INTEREST". For general help, send
email to listserv@java.sun.com and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Joe Bowbeer

BigInteger.class is huge. If all the dependencies are really satisfied,
then my next guess is that the BigInteger classfile is too large for your
mobile-edition VM. Just a guess.

On Jan 16, 2008 12:20 PM, Padilla, Alex D wrote:

> Thanks, Joe for the reply. I added BigInteger and some other classes
> into the classpath during compilation. Everything compiled fine. The
> new classes were added successfully as I can use them in programs I have
> created. The only class I added to the CLDC that is giving me problems
> is the BigInteger class. Any ideas?
>
> -----Original Message-----
> From: A mailing list for KVM discussion
> [mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of Joe Bowbeer
> Sent: Wednesday, January 16, 2008 1:16 PM
> To: KVM-INTEREST@JAVA.SUN.COM
> Subject: Re: BigInteger Problems
>
> BigInteger is not part of CLDC. It should not be found in the javac
> bootclasspath that defines your target platform, assuming CLDC is your
> target config, and your code should not compile.
>
> On 1/16/08, Padilla, Alex D wrote:
> > Does anyone know why the BigInteger class would not work in J2ME? I
> > am trying to use it and everything compiles fine. When I try to run
> > the program it just hangs. Thank you in advance.
> >
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]