Skip to content

LastSurvivalOn/j2me-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖁 j2me-template

Build with Make
Platform
License: MIT

A lightweight starter template for creating Java ME (J2ME) applications using MIDlet. Designed to help you quickly set up new projects for the Java ME platform (CLDC + MIDP).


📦 Project Structure

repo/
├── img/
│   └── example.png
├── mk/
│   ├── actions.mk
│   ├── paths.mk
│   └── rules.mk
├── src/
│   └── Main.java
├── .env.sample
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
└── icon.png

⚙️ Requirements

Tool Version Purpose Local file name
Make 3.81 (Windows) Automate build commands (make build, make run, etc.) (installed manually)
Zulu JDK 8 1.8 Compile .java zulu8.86.0.25-ca-jdk8.0.452-win_x64.msi
Java ME SDK 3.4 3.4 CLDC/MIDP libraries oracle-jmesdk-3-4-rr-win32-bin.msi
JRE 6 1.6 Emulator runtime jre-6u37-windows-i586.exe
Nokia SDK Series 40 6th Edition Optional, to run apps S40_6th_Edition_SDK.exe

🛠️ Setup Instructions

1. Clone the project

git clone https://github.com/LastSurvivalOn/j2me-template.git
cd j2me-template

2. Create .env file

cp .env.sample .env

Then edit .env with your absolute paths.

Example:

JDK=D:/Nokia/ZuluJDK8
SDK=D:/Nokia/J2ME_3.4_SDK/Java_ME_platform_SDK_3.4
JAVA_HOME=D:/Nokia/jre6
NOKIA_SDK=D:/Nokia/S40_6th_Edition_SDK

APP_FILE_NAME=launch
MIDLET_NAME=APP
MIDLET_VENDOR=Author
MIDLET_VERSION=1.0
MIDLET_CLASS=Main
MIDLET_PROFILE=MIDP-2.1
MIDLET_CONFIG=CLDC-1.1
MIDLET_ICON=icon.png
MIDLET_PERMISSIONS=javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write

SRC_DIR=src
BIN_DIR=bin
DIST_DIR=dist
RES_DIR=res

MANIFEST_FILE=manifest.mf
MANIFEST_FILE_VERSION=1.0

🚀 Commands

Command Description
make help Show available commands
make build Compile .java, package .jar, generate .jad
make clean Remove build artifacts (bin/, dist/)
make run Launch in Nokia Series 40 Emulator
make all cleanbuildrun (full cycle)

✍️ Example

Below is a screenshot of a successful make run (or make all) execution:

make run screenshot


🧪 Testing Environment

This project has been tested both on an emulator and a real device:

  • Emulator: Nokia S40 6th Edition SDK Emulator
  • Real Device: Nokia 112

The MIDlet successfully launches, displays the intended screen, and operates as expected on the real hardware.


🔥 How It Works

  1. Compile:
    Java source (src/) → Compiled .class files (bin/).

  2. Manifest:
    Auto-generated manifest.mf based on .env configuration.

  3. Package:
    .class + resources zipped into .jar (dist/).

  4. Descriptor:
    .jad file is created — needed for emulator/device installation.

  5. Run:
    Emulator starts and installs your app.


📄 Code Example

Simple MIDlet example (Main.java):

TextBox helloScreen = new TextBox("Hello", "Hello, Nokia 112!", 256, 0);
display.setCurrent(helloScreen);

🧹 Ignored by Git

.env
.vscode/
bin/
dist/
manifest.mf

📸 Icon Requirements

  • Format: PNG
  • Size: Recommended 32×32 pixels
  • Path: Should be at project root (icon.png) unless changed in .env.

❓ FAQ

  • Can I rename manifest.mf?
    ➔ Yes, configure MANIFEST_FILE in .env.

  • Supported platforms?
    ➔ Windows

  • Cross-compilation?
    ➔ Yes, you can build .jar on PC and transfer via Bluetooth to a real device.


✨ Future Plans

  • Linux optimized Makefiles
  • Docker-based builds for CI

🧠 Quick Start

make all

✔ Your MIDlet is ready inside dist/ 🚀


📜 License

This project is licensed under the MIT License.


👨‍💻 Author

Made with ❤️ by LastSurvivalOn

About

A basic starter template for creating Java ME (J2ME) projects using MIDlet.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published