-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Jre4Android lets you run Java JAR files and Java class files on Android.
Before running a file, please check the supported Java version and choose the correct run type.
The free version supports:
- Java 17 or earlier — fully supported, no ad required
- Java 21 — supported after watching an ad
Java 22 or higher is not supported and may cause the app to crash or fail to run.
The Pro version supports:
- Java 25 or earlier — fully supported, no ad required
Java 26 or higher is not supported and may cause the app to crash or fail to run.
Jre4Android supports different kinds of Java applications.
After selecting a JAR file, you may need to choose a run type such as:
- J2ME type
- Swing type
- Terminal type
This is important because different Java programs need different runtime modes.
If you choose the wrong type, the app may fail to run correctly.
You can use Jre4Android to run a Java JAR file.
This is similar to the following desktop command:
java -jar xxx.jar
- Open Jre4Android
- Choose Run .jar
- Select the JAR file you want to run
- Choose the correct run type
- Start the program
After selecting a JAR file, choose the type that matches your Java application.
Choose J2ME type if the JAR file is a Java ME / MIDlet application or game.
Use this type for:
- old mobile Java games
- J2ME apps
- MIDlet-based applications
If your JAR was originally made for older feature phones, this is usually the correct choice.
Choose Swing type if the JAR file is a desktop Java GUI application that uses Swing.
Use this type for:
- Java desktop applications with windows and buttons
- Swing-based GUI tools
- Java programs that open a graphical interface
If the program is supposed to show a desktop-style GUI, use this type.
Choose Terminal type if the JAR file is a console / command-line Java program.
Use this type for:
- command-line tools
- text-based Java programs
- server JAR files
- programs that print output in a terminal
If the program normally runs like this on desktop:
java -jar xxx.jar
and shows text output instead of a graphical window, choose Terminal type.
This is usually the correct type for:
- console apps
- utility tools
- Minecraft server JAR files
- Spring Boot JARs
- command-line Java programs
- the app is a Java ME / MIDlet app
- it was designed for old mobile phones
- it is a J2ME game
- the app should open a graphical desktop-style window
- it uses Swing UI components
- the app runs in command-line mode
- it prints text output
- it is a server or console application
If you are not sure, try to identify what kind of Java program it is before running it.
Jre4Android can also run Java class files.
This is useful if you want to run a compiled Java class directly instead of packaging it into a JAR.
If the class file does not depend on any other JAR files, you can run it directly.
This is similar to the following desktop command:
java Hello
Here, Hello refers to Hello.class.
- Open Jre4Android
- Choose Run .class
- Select the
.classfile you want to run - Start the program
If you want to run:
Hello.class
Jre4Android will run it like:
java Hello
If the class you want to run depends on one or more external JAR files, you must add those JAR files to the classpath first.
For example, if:
-
A.classis the class you want to run -
B.jaris required byA.class
then you need to add B.jar through the app settings before running A.class.
This is similar to the following desktop command:
java -cp B.jar A
- Open Settings
- Find Add jars to classpath
- Add the required JAR file(s), such as
B.jar - Go back and choose Run .class
- Select the class file you want to run, such as
A.class
If your Java program needs additional library JAR files, you must add them to the classpath.
This is commonly needed when:
- a
.classfile depends on external libraries - your Java code uses third-party JAR files
- the program cannot find required classes at runtime
To do this:
- Open Settings
- Tap Add jars to classpath
- Select the required JAR dependency files
- Run your main
.classfile again
- Make sure your JAR or class file was compiled with a supported Java version
- Choose the correct run type after selecting a JAR file
- If your program requires external libraries, add them to the classpath before running
- Unsupported Java versions may cause crashes or startup failures
- Some desktop Java programs may not work correctly on Android, depending on their design and required environment
- Select Run .jar
- Choose your
.jarfile - Select the correct run type:
- J2ME type for Java ME / MIDlet apps
- Swing type for desktop GUI apps
- Terminal type for console and server apps
- Select Run .class
- Choose your
.classfile
- Open Settings > Add jars to classpath
- Add required JAR files
- Run the
.classfile
- If a JAR file does not run, first check its Java version
- If a JAR opens in the wrong mode, try a different run type
- If a class file fails to start, check whether it needs extra JAR files in the classpath
- If you are unsure which type to use:
- choose J2ME type for Java ME apps and games
- choose Swing type for graphical desktop Java apps
- choose Terminal type for console apps and servers
Below are some sample JAR files that have been tested successfully in Jre4Android.
They demonstrate support for terminal programs, interactive input/output, local networking, and Swing GUI applications.
A simple program that prints Hello jdk!!! in the terminal.
Download:
Hello.jar
Expected result:
Hello jdk!!!

A simple HTTP server example.
After running the JAR, open the following address in your phone browser:
http://localhost:8080
Download:
HttpServerDemo.jar
Expected result:
The local web server starts successfully, and the browser can access the demo page.

A simple console program that prints a triangle pattern in the terminal.
Download:
PrintTriangle.jar
Expected result:
Prints a triangle made of * characters.

Displays the local host address and host name in the terminal.
Download:
IpAndHostName.jar
Expected result:
Local HostAddress: 127.0.0.1
Local host name: localhost

Fetches and prints the HTTP response headers from https://www.google.com.
Download:
PrintGoogleHeader.jar
Expected result:
Prints HTTP header information in the terminal.

A simple interactive console example that reads user input and prints it back.
Download:
BufferedReaderExample.jar
Expected result:
The app accepts typed input and echoes it in the terminal.

A minimal Swing desktop GUI example.
Download:
HelloWorldSwing.jar
Expected result:
A small Swing window opens successfully on Android.

A more advanced Swing application used for digital logic design and simulation.
Download:
logisim-evolution-3.8.0-all.jar
Expected result:
The full desktop-style Swing UI runs on Android, including menus, toolbars, panels, and interactive editing.
