File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes running Java in mobile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "running Java in mobile" Watch "running Java in mobile" New topic

running Java in mobile

Rajat Sarkar

Joined: Sep 07, 2008
Posts: 18
Java is platform-independent.Why my written Java programs do not run in my mobile.I've created a .jar file of my application.How to run this jar in my mobile? I use Java SE 6.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
You may need to install Java on your mobile. Most mobiles don't use J2SE but the micro edition (J2ME), so a Java SE file may contain classes which J2ME doesn't support.

Probably better discussed on our mobile forum . . . moving.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Java Micro Edition was designed to allow Java to run in devices with limited amounts of memory and CPU horsepower. Not only does it not implement all the classes that are supported by J2SE, many classes don't support all the methods that the full J2SE implementation provides. J2ME has its own set of JavaDocs that list what's provided.

JME also requires a slightly different build process. You can't just create a JAR and load it into the device.

For more information, look at Sun's JME documentation on their website.

An IDE is no substitute for an Intelligent Developer.
Darryl Burke

Joined: May 03, 2008
Posts: 5115

About this statement
Java is platform-independent.

Only to the extent that Java bytecode can be executed on a device that has a JVM (or in the case of most mobile devices, KVM) engineered for the platform, and a JRE that supports the classes used by the program.

As already stated, you can't run a Java SE program on a device that supports Java ME.

luck, db
There are no new questions, but there may be new answers.
bharath bs

Joined: Nov 14, 2008
Posts: 3
try midp2 to trns jar to mobile it works fine
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

"BHARATH bms" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.

|Asking Good Questions|
I agree. Here's the link:
subject: running Java in mobile
It's not a secret anymore!