Wikia

Vim Tips Wiki

J2ME development

Talk0
1,610pages on
this wiki
Revision as of 23:53, September 29, 2008 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Tip 1107 Printable Monobook Previous Next

created January 16, 2006 · complexity intermediate · author peter · version 6.0


When using Vim to write J2ME programs for mobile phones, you may find the following useful in your vimrc:

set makeprg=jikes\ -nowarn\ -classpath\ tmpclasses\ -d\ tmpclasses\ -sourcepath\ src\ -Xstdout\ +E\ %
set errorformat=%f:%l:%c:%*\\d:%*\\d:%*\\s%m

map <M-1> :make<CR>:cw5<CR>
" cw5 help you to see the error (from {{help|:cn}})
map <M-2> :!preverify -classpath c:\wtk22\lib\cldcapi10.jar;c:\wtk22\lib\midpapi10.jar -d bin tmpclasses<CR>
" preverify is important before running the WTK emulator.

" This emulator is specific for ZhanGuo project: (change zhanguo.jad to yourfile.jad)
" It's best that the jad is generated by WTK22 such that it
" place it in : c:\wtk22\apps\zhanguo (zhanguo is your project name)
map <M-3> :!c:\wtk22\bin\emulator.exe -classpath bin -Xdescriptor:zhanguo.jad<CR>

cmap %/ <C-R>=expand("%:p:h")."/"<CR>

You need to have path on c:\wtk22\bin (or else you need full path in many places).

SET PATH=c:\wtk22\bin;%PATH%

Need to create two directories, normally created by WTK22 or by hand:

cd c:\wtk22\apps\[project]
mkdir tmpclasses
mkdir bin

Also, you need to start editing in the project path, not the src path. e.g.

cd c:\wtk22\apps\[project]
vim src\MyMidlet.java

Do not go out of the [project] path. If you need to edit another file, do:

:e %/

This will auto expand to the current [editing] directory.

CommentsEdit

Advertisement | Your ad here

Around Wikia's network

Random Wiki