---
title: "Why cannot you run standard Java bytecode on Android?"  
description: "Why cannot you run standard Java bytecode on Android?"  
author: "Hemant Patel"  
published: 2018-01-21  
canonical: https://answers.mindstick.com/qa/33339/why-cannot-you-run-standard-java-bytecode-on-android  
category: "technology"  
tags: ["android"]  
reading_time: 1 minute  

---

#  Why cannot you run standard Java bytecode on Android?

Why [cannot you run standard](https://www.mindstick.com/interview/2560/why-cannot-you-run-standard-java-bytecode-on-android) [Java](https://www.mindstick.com/articles/1702/introduction-to-java) bytecode on [Android](https://www.mindstick.com/articles/1672/android-internals)?

## Answers

### Answer by Arti Mishra

Because Java uses **JVM (Java Virtual Machine)** for compile any program and **generated [standard](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) bytecode or magic code,** in another point of view **android uses** **DVM (Dalvik Virtual Machine)** for running any applications. **Java bytecode is different from android Dalvik bytecode and this bytecode is not executable code** for an android application. Because **android Dalvik bytecode is first to optimize for make it mobile friendly** and JVM bytecode can’t make code mobile friendly.

\

![Why cannot you run standard Java bytecode on Android?](https://answers.mindstick.com/questionanswer/60f437e2-42a4-4120-b12e-ecc7b3519863/images/483bd337-a166-411b-ad9e-7f711cfa6389.png)\
\
Generally, Android apps **uses different XML file** for developing an application, but **Java doesn’t use any XML file** for running any program. **Android DVM uses the dx.jar file for generating Dalvik bytecode** but JVM doesn’t use any external file for generating bytecode. These are the main important points that, Java bytecode can’t run on android studio projects. \
\
\
**"Thanks!!! for Reading"**


---

Original Source: https://answers.mindstick.com/qa/33339/why-cannot-you-run-standard-java-bytecode-on-android

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
