Skip to content

TASEmulators/freej2me-plus

 
 

Repository files navigation

BannerFinal

Current status

Java CI Website Java version License Open Issues Last Commit

Links to FreeJ2ME-Plus Builds

Nightly Releases Latest Stable Release


❓ What is it?

FreeJ2ME-Plus is a J2ME emulator with libretro and AWT frontends, it aims to run on basically anything that can run a Java VM.

Original authors :

- David Richardson [Recompile@retropie]

- Saket Dandawate [Hex@retropie]

Current maintainer:

- Paulo Sousa [AShiningRay]


📊 Compatibility list

For a general idea of what can or cannot run, look HERE


⚙️ ☕ Building FreeJ2ME-Plus

Make sure you have Apache Ant installed and can run it. Then, from the freej2me directory, run the following command (yes, it's that simple):

> ant

That command will create two different jar files inside build/:

freej2me.jar -> Standalone AWT jar executable, can be double-clicked right away to start

freej2me-lr.jar -> Libretro executable (has to be placed on the frontend's system/ folder, since it acts as a BIOS for the libretro core and is what runs J2ME jars)

NOTE: The Libretro jar file needs additional binaries to be compiled before use. Look at the additional steps below if you're going to use it.

⚙️ 🎮 Building the Libretro core

Building for Linux:

To build the libretro core, be sure you can run the make command, then open a terminal in freej2me's folder run the following commands from there:

# libretro core compilation
> cd src/libretro
> make

This will build freej2me_libretro.so on src/libretro/, which is the core libretro will use to interface with freej2me-lr.jar.

Move it to your libretro frontend's cores/ folder, with freej2me-lr.jar on system/ and the frontend should be able to load j2me files afterwards.

NOTE: The core DOES NOT WORK on containerized/sandboxed environments unless it can call a java runtime that also resides in the same sandbox or container, keep that in mind if you're running a libretro frontend through something like flatpak or snap for example.

Building for Windows:

To build the libretro core for windows, first you'll need mingw, or MSYS2 64. This guide uses MSYS2 as it's easier to set up and works closer to linux syntax.

Download MSYS2-x86_64 and install it on your computer. By default it will create a linux-like 'home' folder on C:\msys64\home\ and will put a folder with your username in there. This is where you have to move the freej2me folder to, so: C:\msys64\home\USERNAME\freej2mefolder for example.

With the folder placed in there you can build the core, open the MSYS2 UCRT64 terminal from your pc's start menu, and run the following commands:

# Installing 'mingw-w64' and 'make' on msys2
> pacman -S mingw-w64-ucrt-x86_64-gcc
> pacman -S make

# libretro core compilation
> cd freej2mefolder/src/libretro
> make

This will build freej2me_libretro.dll on freej2mefolder/src/libretro/, which is the core libretro will use to interface with freej2me-lr.jar.

Move it to your libretro frontend's cores/ folder, with freej2me-lr.jar on system/ and the frontend should be able to load j2me files afterwards.

NOTE: The windows core has been tested on Windows 7, 10 & 11 x64.


📝 How to use the AWT frontend:

Launching the AWT frontend (freej2me.jar) directly will bring up the standalone GUI, where you can load your application through the File menu, or by dragging and dropping your JAR/JAD/KJX/MSD file onto it.

You can also configure many aspects of the runtime, including debug options:

image image image image

Alternatively it can be launched from the command line with the following arguments:

  • fullscreen ➡️ 1 = yes, 0 = no
  • width ➡️ self explanatory, it's the virtual LCD's width
  • height ➡️ also self explanatory, it's the virtual LCD's height
  • scale ➡️ for windowed mode, dictates the scale that FreeJ2ME-Plus' window starts with.
    • '2' will make it 2X bigger than the original width and height size for example
  • keyLayout ➡️ specifies which device key layout should be used when booting up. These can be:
    • 0 -> Default
    • 1 -> LG
    • 2 -> Motorola/Softbank
    • 3 -> Motorola Triplets
    • 4 -> Motorola V8
    • 5 -> Nokia Keyboard
    • 6 -> Sagem
    • 7 -> Siemens
    • 8 -> Sharp
    • 9 -> SKT
    • 10 -> KDDI
  • framerate ➡️ sets the maximum FPS applications are allowed to run at.
    • Can be any value, although '10' to '60' is the expected ballpark

Those are organized and read internally in this manner: java -jar freej2me.jar 'file:///path/to/midlet.jar' fullscreen width height scale keyLayout framerate

Although all arguments aside from the path are optional to launch FreeJ2ME-Plus with any given app.

Notes:

When running under Microsoft Windows please do note paths require an additional / prefixed. For example, C:\path\to\midlet.jar should be passed as file:///C:\path\to\midlet.jar

FreeJ2ME keeps savedata and config at the working directory it is run from. Currently any settings specified at the config file take precedence over the values passed via command-line.


🔍 Modules and external dependencies used:

  • JLayer(MPEG Player): - LGPLv2.1 License, compatible with GPLv3

  • libsdl4j: zlib License, compatible with GPLv3

  • ObjectWeb's ASM: BSD 3-Clause License, not directly compatible with GPLv3, but can be used as long as the original license is published alongside GPLv3 (check the 'License' tab)

  • Libretro's API: MIT License, compatible with GPLv3


👥 How to contribute

If you're a developer:

  1. Open an Issue
  2. Try solving that issue
  3. Post on the Issue if you have a possible solution
  4. Submit a PR implementing the solution

If you're an user:

  1. Open an Issue
  2. Explain it in as much detail as you can (FreeJ2ME-Plus version, jar used, md5 hash, as well as the issue with logs and images if possible)
  3. Post a save file close to where the issue manifests, or note the steps required to reproduce it

About

A free J2ME emulator with libretro, awt and sdl2 frontends.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 85.2%
  • C 14.4%
  • Other 0.4%