Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Usually, you cannot open an arbitrary desktop Java .jar directly on Android. The correct method depends on what you have: an Android project, a desktop Java program, an old Java ME game, or Java source you simply want to execute. Android apps run through Android Runtime (ART) from Android-compatible DEX bytecode, not ordinary desktop Java class files. See Android Runtime documentation.

Use the decision guide below to choose the route that actually fits your file.

First, identify what kind of Java app you have

What you have What it usually is Best route
.java files in an Android Studio project, with Gradle files and AndroidManifest.xml Native Android source Build and run it with Android Studio
An executable desktop .jar or installer Java SE software for Windows, macOS or Linux Port/rebuild it, use a compatible JVM environment if the specific program supports one, or run it on another computer remotely
An older .jar, often accompanied by a .jad file, from a Nokia-era phone Java ME/J2ME application Use a J2ME emulator such as J2ME Loader
Standalone Java source or a small console program Ordinary Java code Run it in Jvdroid or a terminal such as Termux
An .apk Already-packaged Android app Install it with Android’s package installer, subject to compatibility and security checks

A .jar can also be a library rather than an application. An Android App Bundle (.aab) is a publishing artifact and is not normally installed by tapping it like an APK.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick decision tree

  1. If you have an APK, install that APK through Android’s normal installer.
  2. If you have an Android Studio project, build it on a computer with Android Studio.
  3. If you have Java source, determine whether it uses Android APIs or desktop APIs such as Swing, AWT or JavaFX.
  4. If the JAR came from an old feature phone, try J2ME Loader.
  5. If you want to learn Java or run a console utility on the phone, use Jvdroid or Termux.
  6. If you need an unchanged desktop application, control a computer running it through remote desktop instead of expecting Android to launch it natively.

Why a desktop Java JAR does not normally run on Android

Android supports Java language syntax and a Java-based toolchain, but it is not a conventional Oracle/OpenJDK desktop installation. Android code is compiled and packaged for the Android platform; ART executes DEX bytecode and applies Android’s application, permission and lifecycle model. Read the platform overview at developer.android.com/guide/platform.

#1 Best Overall
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

A desktop program may require Swing or AWT windows, JavaFX, unrestricted desktop file paths, keyboard and mouse input, desktop sockets, native libraries, or Java SE APIs that Android does not provide. Installing a generic “Java runtime” does not convert Android into a Windows, macOS or Linux JVM.

Porting normally means keeping reusable business logic, replacing the user interface with Android-compatible screens, adapting storage and lifecycle behavior, and rebuilding native components for Android ABIs such as ARM. A program can compile successfully and still fail because a dependency or native library is unavailable.

Build and run Java Android source with Android Studio

What you need

  • A computer with Android Studio and an Android project, or source adapted to Android.
  • A suitable JDK. Android Studio includes the JetBrains Runtime; Gradle uses the JDK selected in Android Studio or JAVA_HOME. Check the current compatibility guidance at Android’s JDK documentation.
  • Either a physical Android phone/tablet or an Android Virtual Device.

Run on a physical device

  1. On the phone, open Settings → About phone and tap Build number repeatedly until Developer options are enabled. Names vary by manufacturer.
  2. Open Developer options and enable USB debugging.
  3. Connect the phone with a data-capable USB cable and unlock it.
  4. On the computer, verify the connection:
    adb devices

    Accept the RSA authorization prompt on the phone. The device should appear in the list.

  5. In Android Studio, select the app run configuration, select the connected phone, and click Run.
  6. Android Studio builds a debug APK, installs it and launches it. Build and runtime details appear in the IDE and Logcat; see Android Studio debugging documentation.

For the official device procedure, including Windows drivers and Linux permissions, see Connect to a device.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install an already-built APK with ADB

Use an APK built for the device’s Android API range and CPU architecture:

adb install path/to/app-debug.apk

To update an existing compatible installation while retaining its data:

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
adb install -r path/to/app-debug.apk

If more than one device is connected, target a physical device explicitly:

adb -d install path/to/app-debug.apk

A debug APK is for testing. Normal distribution requires a correctly signed release build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Android Studio cannot see the phone

  • Run adb devices again with the phone unlocked and accept the authorization dialog.
  • Try another cable or USB port and select a data-transfer USB mode.
  • Restart ADB:
adb kill-server
adb start-server
adb devices
  • Install the applicable OEM USB driver on Windows.
  • On Ubuntu/Linux, follow Android’s documentation for the plugdev group and udev rules.

Test an Android app in the Emulator

The Android Emulator is for Android APKs and Android projects; it is not a general desktop-Java emulator. In Android Studio, create an Android Virtual Device, choose it as the deployment target, and click Run. The workflow is documented at Android Emulator.

Android’s current guidance lists 16 GB RAM, 16 GB available disk space and a 64-bit Windows 10 or later, macOS 12 or later, Linux or ChromeOS system as minimum recommended specifications for a good experience. Larger virtual devices or newer API levels may need more. The emulator is useful for repeatable testing across Android versions, but a physical phone can reveal hardware, sensor and performance issues that a virtual device does not.

Run Java code directly on the phone

Jvdroid: easiest for learning and small programs

Jvdroid’s current Google Play listing describes offline compilation using standalone OpenJDK 11, Maven project and library support, a terminal emulator and a JShell-based REPL. It requires at least 250 MB of free internal storage, with 300 MB or more recommended. The listing explicitly says it does not build native Android applications. See the Jvdroid listing.

Rank #3
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
  1. Install Jvdroid from Google Play.
  2. Create a file named Main.java.
  3. Enter a class with a main method:
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello from Android");
    }
}
  1. Save the file and tap the compile/run control.
  2. Read the result in Jvdroid’s console.

This is ordinary Java execution inside Jvdroid’s bundled environment. It suits exercises, algorithms, command-line tools and small Maven projects. It does not create an installable APK or provide Android activities, services, notifications, permissions or lifecycle testing. The U.S. Play listing observed in August 2026 showed a separate Jvdroid Pro listing at $9.99; regional prices, taxes and promotions can change.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Termux: flexible terminal-based development

Termux is a terminal emulator with an extendable Linux-like userland and package system. Its project documentation is at github.com/termux/termux-app. Install it from one consistent official distribution source; do not mix APKs and repositories casually. The project documents differences between its Google Play and F-Droid builds at github.com/termux/termux-play-store.

Where the selected Termux distribution provides an OpenJDK package, a typical workflow is:

pkg update
pkg upgrade
pkg search openjdk
pkg install openjdk
java -version
javac Main.java
java Main

Package names and availability vary by distribution and device architecture, so check the current repository guidance rather than assuming every build contains the same packages. Termux is a strong choice for Git, shell scripts, servers, package management and command-line Java; it is less approachable than Jvdroid for someone who wants a visual editor and one-tap Run button.

Run old Java ME/J2ME apps and games

Many old feature-phone games are not desktop Java at all. They target Java ME (also called J2ME), commonly arrive as a .jar with a .jad descriptor, and need an emulator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
  1. Install J2ME Loader from a reputable source such as its F-Droid page.
  2. Copy a legally obtained J2ME JAR to the phone.
  3. Open J2ME Loader and use its add/import function to select the JAR.
  4. Launch the title.
  5. Adjust per-game controls, virtual keyboard, scaling, screen layout or graphics options when necessary.

The F-Droid listing describes support for most 2D and 3D games, a virtual keyboard and individual scaling/settings. It showed version 1.8.2, added August 12, 2024, with Android 4.0 or newer; check the listing for the version currently available.

J2ME problems you may encounter

  • The JAR may be a desktop application or library rather than a J2ME MIDlet.
  • A missing .jad descriptor or proprietary handset feature can prevent launch.
  • Touch controls, sound, networking, save files and 3D rendering may differ from the original phone.
  • Only use games and applications you are entitled to use; an emulator does not grant permission to download copyrighted files.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When a desktop Java application must remain unchanged

If porting is impractical, run the software in its original desktop environment and control that computer from Android. Microsoft Remote Desktop and Chrome Remote Desktop are examples; see Microsoft’s Android client documentation and Chrome Remote Desktop. This requires a computer or hosted server, a network connection and a setup that tolerates mobile latency. It is not an offline installation of Java on the phone.

A specialized JVM or Linux environment can work for particular applications, but compatibility is application-specific. Do not assume that a generic runtime will handle Swing, JavaFX, native libraries or desktop filesystem behavior.

Troubleshooting common failures

“I tapped a JAR and nothing happened”

Confirm whether it is a desktop JAR, J2ME JAR or library. Android’s package installer expects an APK, not a JAR. Use J2ME Loader for a feature-phone title, Jvdroid/Termux for source or console code, or port the desktop application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Unsupported class version”

This indicates bytecode and runtime/build-tool incompatibility. Check the Gradle JDK selected by Android Studio, the Java language and bytecode target, compatible Android Gradle Plugin/Gradle versions, required desugaring and the Java level used to build dependencies. Updating or lowering the target may be necessary; exact versions change with Android Studio releases.

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US

“It installs but crashes immediately”

Inspect the actual failure instead of assuming Java itself is unsupported:

adb logcat

Look for ClassNotFoundException, NoSuchMethodError, UnsupportedClassVersionError, missing native libraries, ABI mismatches, permission failures, network-security errors and Android lifecycle/resource errors.

Missing native libraries

Desktop files such as .dll, .dylib or desktop Linux .so files cannot simply be bundled unchanged. They must be replaced or rebuilt for Android’s supported ABI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Permissions and filesystem failures

Android applications run in a sandbox and follow Android storage, permission and background-execution rules. Code expecting unrestricted desktop paths, system-wide services or permanent background execution must be redesigned.

J2ME controls or imports fail

Try importing the matching JAR and JAD when supplied, then configure the title’s virtual keys and scaling. A game can be correctly emulated yet remain awkward or incomplete because it depended on a handset-specific API.

Termux package errors

Use one Termux distribution and its matching repositories. Mixing Google Play and F-Droid packages or repository configurations can produce dependency and update failures; consult the project’s current distribution instructions.

Which method should you use?

Method Best for Main advantage Main limitation
Android Studio + physical device Building real Android apps Complete, official development workflow Requires a computer
Android Studio Emulator Testing across Android versions and device profiles Repeatable virtual devices Resource-intensive; runs Android apps, not desktop JARs
Jvdroid Beginners and small Java programs Simple offline editor and runner Cannot build native Android apps
Termux Terminal Java, Git, scripts and servers Flexible package-based environment More setup and distribution differences
J2ME Loader Old feature-phone games and apps Purpose-built J2ME compatibility Not a desktop Java runtime; compatibility varies
Remote desktop Unmodified desktop Java software Preserves the original environment Needs another computer or hosted machine and a network
Port or rebuild Important desktop software you need as an Android app Produces a native Android package Can require substantial engineering

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.