I downloaded some 3D games, unzipped them and got .jar files. How can I use these in Android? I have a Galaxy S running 2.1.


Although Android uses java, it doesn't support normal JAR files. Instead it uses an Android specific format called APK. The main difference is that Android does not use the normal Java Virtual Machine, but contains it's own Dalvik Virtual Machine that's optimized for Android.

  • you means to say that i can not install jar file in android 2.1. – Jeevan Bhatt Jan 12 '11 at 9:01
  • 5
    @Jeevan Bhatt: Exactly. This can change in the future (if someone writes a JVM for Android) but I wouldn't hold my breath. – onik Jan 12 '11 at 10:47
  • I did search on internet and came to know that android support only apk file so i need to convert .jar into .apk by some converter, is it true? – Jeevan Bhatt Jan 12 '11 at 12:25
  • 4
    Yes, there are some converters but these are not very reliable. The problem is, Android uses a part of the entire java library and adds it's own libraries to control most of the features. For example, the Graphical User Interface classes can't be used on Android (eg. swing). Also the converter needs to rewrite all UI events, such as touchscreen/keyboard functionality. Apparently some converters can do this for MIDP applets (J2ME) used on older phones, but normal Java apps (probably) will not work. You can try the converters, but most likely the result will lag, be buggy or crash. – onik Jan 12 '11 at 12:50

I'd like to partially disagree with Ryan Conrad & Onik.

I have a Samsung Spica and it came pre-loaded with an app while it was running v1.6 and now running 2.1 (both official Samsung India versions) - called Java ME Apps.

I am running multiple Java apps (meant for non-Android phones) through it.

Both are JAR files and once run via the Java ME app, both run as expected.

So to sum up, there is a way to run JAR apps on Android. I do however, agree with everything else mentioned WRT APKs and Dalvik.

  • That Formula 1 App you linked seems to be a native android app and not a java/j2me app.. – Irfan Jan 26 '12 at 7:38
  • 1
    Now it is... when I'd originally posted it, there wasn't an Android version - just the J2ME one. ;-) – Sparx Jan 28 '12 at 12:07
  • how did u run that? – inquisitive Aug 10 '15 at 6:00

Android doesn't actually even "use" java. The language that the code is written in is Java, but the android SDK takes the compiled bytecode and converts it in to the Dalvik bytecode.

So it is really a misconception that Android runs java. Android runs Dalvik, which the core libraries are based on the Java framework, but the end resulting binary files are not the same, and the virtual machines are also completely different.

Just like the Dalvik VM will not run Java bytecode, the Java VM will not run Dalvik bytecode.

Converting libraries to Dalvik is probably possible, if all the features are available in Android (or additional libraries), but anything that has a Java UI, will not work.

  • I actually disagree. Google did not wrote there own Language called Java, they just simply i believe took the OpenJDK and name it Dalvik etc etc for marketing. – YumYumYum Nov 11 '11 at 12:31
  • 1
    have you ever compared dalvik byte code to java byte code, its different. – Ryan Conrad Nov 11 '11 at 13:13
  • 1
    @Google: That is, literally, completely wrong. Google used Java syntax (and some libraries), but as Ryan Conrad noted, the bytecode is completely different. They didn't just "rename" the Java JDK for marketing purposes. See Dalvik's Wikipedia entry for more. – eldarerathis Dec 3 '11 at 22:38

If the jar file is for JavaME

There is MicroEmulator which emulates JavaME with help from JavaSE. This makes it possible to convert these jar files to an apk and install it on your device. The process is described here.

NetRunner provides a similar functionality.

  • Flow, that MicroEmulator link seems to have changed to something else I suppose. Could you please update the answer. – Firelord Sep 30 '15 at 21:05

No, you cannot install jar files in android, to install applications from jar we need J2ME support which is not in android phones.

Not the answer you're looking for? Browse other questions tagged or ask your own question.