之後您就會在目錄底下發現新產生了一個名為output的目錄,裡頭存放的正是經過預先審核的HelloWorld.class。
| c:\j2me_cldc\bin\kvm -classpath c:\j2me_cldc\bin\api\classes;.\output %1 |
當palmtest.bat完成之後,我們只要在命令列下打入:
| palmtest HelloWorld |
|
使用滑鼠在 Goodbye World 這個按鈕上按下滑鼠左鍵,此程式就會關閉。
其實這個CLDC內附的模擬器可以幫我們輸出一些程式執行時期的相關資料。如果您想要觀看,請將palmtest.bat的內容修改如下:
| c:\j2me_cldc\bin\kvm -verbose -classpath c:\j2me_cldc\bin\api\classes;.\output %1 >> result.txt |
這樣您就能夠在程式執行之後,打開result.txt觀看KVM所輸出的一些訊息,如果您要直接讓這些訊息輸出到螢幕上,請將palmtest.bat裡頭的">>result.txt"拿掉即可。下面是HelloWorld執行時螢幕上所輸出的資訊:
| GC heap size: 150000 bytes Loading version information Loading constant pool Loading class info Class info ok Loading interfaces Loading fields Loading extra attributes Extra attributes loaded Fields loaded ok Loading methods Method ’main’ Method ’< init >’ Method ’paint’ Method ’penDown’ Method ’< clinit >’ Methods loaded ok Loading extra attributes Extra attributes loaded Closing classfile Class loaded ok Invoking static initializer Invoking static initializer Invoking static initializer Invoking static initializer Invoking static initializer Invoking static initializer Invoking static initializer |
| java -cp c:\j2me_cldc\bin\api\classes palm.database.MakePalmApp -v -bootclasspath c:\j2me_cldc\bin\api\classes %1 |
| palmapp HelloWorld |
| HelloWorld HelloWorld" Small icon Generating output file "HelloWorld.prc". |
(請注意,預先審核過的HelloWorld.class要和palmapp.bat放在相同目錄下,否則螢幕上會出現ERROR: java.io.IOException: Cannot find file HelloWorld.class的錯誤訊息。)
|
這個時候您就會看到output目錄下產生了一個名為HelloWorld.prc的檔案,這就是我們所需要能在Palm上執行的程式了。請將這個檔案下載到您的Palm上,您會在Palm的螢幕上看到如下:
|
|
請諸位讀者在散佈您的程式時務必注意。
|
本文关键:利用Java编写手机应用程序PalmOS基础篇
相关方案
- MIDlet Code sig…
- 设计模式(三)-结构模式…
- J2ME中文教程 1 J2ME…
- 使用Mascot Capsul…
- 关于手机的IMEI号问题的一些…
- internet pionee…
- 优化J2ME中的paint()…
- 设计模式(四)-行为模式…
- 利用J2MEUnit进行单元测…
- google阴影下的专业搜索引…
- 3D编程指南第一部分:快速进入…
- J2ME中文教程 2 CLDC…
- 在3D MIDlet应用程序中…
- Bash readline 使…
- 使用Flash Lite 制作…
- 推荐一个mozilla cal…
- Java 3D帖图扭曲…
- RMS从入门到精通之一…
- 设计模式(二)-创建模式…
- J2ME游戏开发中时钟的简单实…




