Studio Wikiv0.8.7

Wiki / Build and export

Build, run, and export from the CLI

Use the installed Studio CLI from a user-owned folder, or export and test with the editor.

Installed command-line workflow

The installed app keeps its CLI at resources\app\cli\j2me.mjs. These PowerShell commands work from any current directory, use a project under your Documents folder, and leave the Studio installation untouched. Install Node.js and the phone tools first. The JDK path below uses the installer’s default folder; update it if you chose another location. Studio and the CLI find a complete Wireless Toolkit in the vendor default location. For a custom toolkit location, add --toolkit PATH to the build command. A source checkout is optional; if you have one, use its cli\j2me.mjs file instead.

powershell
$studio = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\J2MEStudio' 'InstallLocation'
$cli = Join-Path $studio 'resources\app\cli\j2me.mjs'
$tools = Join-Path $env:LOCALAPPDATA 'J2ME-Unity-Tools'
$jdk = Join-Path $tools 'jdk\zulu7.56.0.11-ca-jdk7.0.352-win_i686'
$project = Join-Path $env:USERPROFILE 'Documents\J2ME\CLI Game'
node $cli --help
node $cli new $project
node $cli scenes $project
node $cli inspect $project
node $cli validate $project
node $cli move $project cube 0.25 0 0
node $cli build $project --jdk $jdk

Useful commands and options

The CLI commands are new, scenes, new-scene, startup, move-source, inspect, move, validate, build, and run. Commands return JSON; failures return a nonzero exit code. move changes an object's local position. --scene ID selects a scene for inspect, validate, move, build, or run. Build and run otherwise use the startup scene.

build accepts --jdk PATH, --toolkit PATH, --quality w200i|w995, and --profile. run also accepts --emulator PATH and --resolution WIDTHxHEIGHT. Run rebuilds, then launches FreeJ2ME-Plus. Use Build MIDlet… to export in Studio, Test MIDlet to rebuild and test it, and Run Last Build to start the previous export. In Studio, choose the destination folder when you click Build MIDlet…. The CLI writes its JAR and JAD together under the project's build folder; keep them together when transferring the MIDlet.

Open Studio from PowerShell

To open the project you just built, pass its folder to Studio. The editor uses the same tools as it does when you launch it from Start.

powershell
$install = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\J2MEStudio' 'InstallLocation'
$exe = Join-Path $install 'J2ME Studio.exe'
$project = Join-Path $env:USERPROFILE 'Documents\J2ME\CLI Game'
& $exe --project $project