This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes KVM problems?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "KVM problems??" Watch "KVM problems??" New topic
Author

KVM problems??

ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Is anyone here familiar with the KVM? (The JVM that runs on palmtops?)
I am walking thru the tutorial on Suns website on KVM. I can get the HelloPalm code to compile fine but when I try to run the preverify it fails on loading HelloPalm.class
Has anyone worked with this before...what do my classpath settings need to be?
ANy info would be greatly appreciated.
Ryan


Ryan Headley<br /><a href="http://www.sudovi.com" target="_blank" rel="nofollow">http://www.sudovi.com</a>
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Ryan, GUESS WHAT!! YOU are about to become the new expert on Palmtops, and educate the REST of us on what it is all about. Lucky you!!
(This is my hint that I have not a clue )


"JavaRanch, where the deer and the Certified play" - David O'Meara
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Well,
Once I get it figured out, I'll letcha know. So far I fixed my problem relating to this post. You really have to make sure you've got the correct classpaths setup. That is the worst and its a pain.
However, once you got it, its pretty slick. Another thing though, and this is my new problem. Walking thru Sun's tutorial on KVM, they give you some source code for HelloPalm.java. I finally got the sucker to compile, but it only works inside of the KVMs emulator, (similar to appletviewer with the JDK).
The darn thing crashes on the POSE (Palm OS Emulator..third party) and gives me an error on my Palm Vx. I am going to post a question on Suns Developer connection. There seems to be some help there.
I will keep you all posted...heh, wish me luck!
Ryan
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Thanks Ryan!
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Okay,
I got it. I grabbed some source code from this website, (forgive me, I forgot the link but can post it later). Then I compiled it on my machine using the myriad [sp?] of commands that you use with the KVM, HotSync'd it with my palm and BAM! It worked.
It was just a little app that printed Simple Spotlet on the palm screen. Mind you it was quite simple, but I did modify it a bit and added an Exit button and an Again button to run it more than once and incremented a counter on the screen.
I like this little KVM thing =)
I will try to write something up sometime for those that may want to try, but the website should help too, that where I learned. I did have to tweak it a bit for my setup however.
Here's the link: http://webdev.apl.jhu.edu/~rbe/kvm
Enjoy!!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Spotlets Isn't that cute .
You DO seem to be getting good at this.
If you don't mind I am going to put a link to this thread in the J2ME (Java 2 Micro Edition) forum, since I think that this directly relates to it.
Gotta share the knowledge yaknow! Thanks.
Enzo Chang
Greenhorn

Joined: May 22, 2001
Posts: 4
Ok, actually if you were to follow the examples from SUN completely, it may or may not work. Ryan, you got the right link, I been to that link too, what I can say is the guide there is the nearest to make a working example. But I notice there are few minor tweaks you must follow in order to work. Since Ryan didnt mention about the tweaks, I might as well include it here.
Tips and tricks
1. First you need to compile some java apps to convert .class to .prc. My first attempt fails, then I found out, downloading the latest toolkit already have those apps ready.
Go to c:\j2me_cldc\bin\kjava\tools\palm\classes\palm\database.
If you still want to compile it use this:
c:\j2me_cldc\tools\palm\src\palm\database> javac *.java -d c:\j2me_cldc\tools\palm\classes\database
NOTE - make sure this directory exists!!!
---> c:\j2me_cldc\tools\palm\classes\database
Copy the files Wrapper.prc and DefaultTiny.bmp to the new dir.
If it still pops up error then try include jdk1.3/jre/lib/rt.jar in the classpath.
2. To get java -> prc compare the following with examples given by Ryan. *Note* addition class rt.jar and common classpath.
> set path=c:\jdk1.3\bin;%path%
> set allclasspath=".;classes;c:\j2me_cldc\bin\api\classes;c:\jdk1.3\jre\lib\rt.jar"
> set j2meclasspath="c:\j2me_cldc\bin\api\classes;c:\jdk1.3\jre\lib\rt.jar"
> set commonclasspath="c:\j2me_cldc\bin\common\api\classes"
> javac -g:none -d tmp -classpath %allclasspath% -bootclasspath %j2meclasspath% HelloWorld.java
> c:\j2me_cldc\bin\preverify -d classes -classpath %j2meclasspath% tmp
> java -classpath %allclasspath% palm.database.MakePalmApp -v -bootclasspath %j2meclasspath% -classpath classes;%commonclasspath% HelloWorld
If everything is successful then you should get the .prc in some subdir.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
So how does this "sync" thing work? It looks like you set everything up on a PC to look right, and then majic happens ?
Enzo Chang
Greenhorn

Joined: May 22, 2001
Posts: 4
Its good to try the examples, but dont get too involved with the development using kjava user interface because it is no longer supported officially. Just read the welcome note in UITest examples included in Sun KVM.
So what is supported now? Sun is coming out with MIDP for Palm
OS.
Well you can take a look at this http://java.sun.com/pr/2000/12/pr001212.html
Thats it... Good Luck
P/s : Knowledge belongs to everyone
Enzo Chang
Greenhorn

Joined: May 22, 2001
Posts: 4
Using Hotsync? =) If you have a palm desktop installed then just double click on the .prc file.
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
I imported all of the kAWT stuff as well. That seems pretty cool because I was able to use Toolkit and make the thing beep.
I am writing a beaming app right now, but for some reason the KVM isn't receiving the beam even though I do have the beamReceive method. It tries to send fine, but I am working on the receive thing.
Cindy...hehe sorry I posted this question here, I didn't see a J2ME forum.
Talk to ya soon...this stuff is fun!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: KVM problems??
 
Similar Threads
J2ME for Developing Palm Applications
Samsung vs. Apple
porting the kvm
I can't find the installation files
KVM for Windows and iPAQ