Luc Hermitte (talk | contribs) m (Added to Java category + text reformatted) |
JohnBeckett (talk | contribs) m (Reverted edits by 94.242.211.40 (talk | block) to last version by JohnBot) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=1107 |
|id=1107 |
||
+ | |previous=1103 |
||
− | |title=J2ME development by Vim __PLUS__ WTK22 |
||
+ | |next=1108 |
||
− | |created=January 16, 2006 |
+ | |created=January 16, 2006 |
|complexity=intermediate |
|complexity=intermediate |
||
|author=peter |
|author=peter |
||
|version=6.0 |
|version=6.0 |
||
|rating=9/3 |
|rating=9/3 |
||
+ | |category1=Compiler |
||
− | |text= |
||
+ | |category2=Java |
||
− | If you are same as me, using Vim to write mobile program (J2ME), you may try this. |
||
⚫ | |||
+ | When using Vim to write J2ME programs for mobile phones, you may find the following useful in your vimrc: |
||
+ | <pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | I did a search during the weekend, no luck to find similar tips/scripts, so i tried to collect some and put it there, it works for me, but rather hardcode, especially on emulator part, it's not perfect, welcome for any comments =) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | Edit: c:\progra~1\vim\_vimrc, put these: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | " Above is [stolen] from [[VimTip3]] , thanks Scott for the great tips. |
||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
− | " Above is [stolen] from comment inside [[VimTip2]] , thanks yulya@vdcom.ru for the great tips. |
||
⚫ | |||
− | '''Note on path: ''' |
||
+ | </pre> |
||
− | You need to have path on c:\wtk22\bin (or else you need full path in many places |
+ | You need to have path on c:\wtk22\bin (or else you need full path in many places). |
+ | <pre> |
||
− | + | SET PATH=c:\wtk22\bin;%PATH% |
|
+ | </pre> |
||
− | Need to create |
+ | Need to create two directories, normally created by WTK22 or by hand: |
+ | <pre> |
||
− | + | cd c:\wtk22\apps\[project] |
|
− | mkdir tmpclasses |
||
− | + | mkdir tmpclasses |
|
+ | mkdir bin |
||
+ | </pre> |
||
− | Also, |
+ | Also, you need to start editing in the project path, not the src path. e.g. |
+ | <pre> |
||
− | + | cd c:\wtk22\apps\[project] |
|
− | + | vim src\MyMidlet.java |
|
+ | </pre> |
||
− | + | Do not go out of the [project] path. If you need to edit another file, do: |
|
+ | <pre> |
||
− | + | :e %/ |
|
+ | </pre> |
||
− | This will auto expand to the current [editing] directory. |
+ | This will auto expand to the current [editing] directory. |
⚫ | |||
− | == |
+ | ==Comments== |
− | <!-- parsed by vimtips.py in 0.533870 seconds--> |
||
− | [[Category:Compiler]] |
||
− | [[Category:Java]] |
Latest revision as of 08:55, 1 December 2014
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.