Programming java under Windows CE.. yet again...

Programming java under Windows CE.. yet again...

Post by Preston Crawfor » Sun, 08 Jul 2001 02:58:31



In my eternal quest to find a portable that I can program with Java on so I
can get more familiar with the language, I stumbled on this post.
(http://groups.google.com/groups?q=javac+jornada&hl=en&safe=off&rnum=1...
selm=39756387.A3B2F1FD%40mchp.siemens.de) The author in this post got Javac
to work under Windows CE on a Jornada 680 somehow. Has anyone else found a
way to do this or has anyone seen anything on a site anywhere describing how
to do this? I really want to program Java portably, and so far the only
concrete proof of this working that I've seen is that someone has made it
possible to do this on a Psion handheld
(http://www.hasiland.com/javaonepoc/javac.html). I am seriously considering
buying a cheap Diamond Mako and using that for a while if I can't find
something, so please help me back from the brink. :-)

Preston

 
 
 

Programming java under Windows CE.. yet again...

Post by Chris De Herrera, MVP - Pocket P » Sun, 08 Jul 2001 08:20:09


Hi,
Have you considered Jeode from www.insigina.com?  It offers a Java VM for
the Pocket PC.

--
Chris De Herrera
Microsoft MVP - Pocket PC
http://www.cewindows.net - Most Complete set of FAQs on Windows CE
http://www.purece.com - Pocket PC and Windows CE Discussions



Quote:> In my eternal quest to find a portable that I can program with Java on so
I
> can get more familiar with the language, I stumbled on this post.

(http://groups.google.com/groups?q=javac+jornada&hl=en&safe=off&rnum=1...
Quote:> selm=39756387.A3B2F1FD%40mchp.siemens.de) The author in this post got
Javac
> to work under Windows CE on a Jornada 680 somehow. Has anyone else found a
> way to do this or has anyone seen anything on a site anywhere describing
how
> to do this? I really want to program Java portably, and so far the only
> concrete proof of this working that I've seen is that someone has made it
> possible to do this on a Psion handheld
> (http://www.hasiland.com/javaonepoc/javac.html). I am seriously
considering
> buying a cheap Diamond Mako and using that for a while if I can't find
> something, so please help me back from the brink. :-)

> Preston


 
 
 

Programming java under Windows CE.. yet again...

Post by Preston Crawfor » Sun, 08 Jul 2001 09:40:58




Quote:> Hi,
> Have you considered Jeode from www.insigina.com?  It offers a Java VM for
> the Pocket PC.

Actually, I just figured it out! I can't believe it. It actually works. I'm
editing .java files in Tillanosoft's notepad, compiling them using Personal
Java and running the .class files using the ChaiVM. This is so cool and
unbelievable. Obviously this is very rough, though. And it's going to need
some refinement, but at least I can test examples, etc. I need some help,
though, from anyone who wants to give it a whack, with some refinements.

First of all, here (in brief) is what I did. I'm not promising this will
work for anyone, just telling you (general you) what I did so you can take a
stab at it if you want.

I read and read and read online. Found a good site at
(http://www.hasiland.com/javaonepoc/javac.html) that helped with giving me a
jump start into what one should do. I followed these directions (sort of)
and modified them to fit my needs.

#1 - First of all, I installed Personal Java beta at "\Storage Card\Program
Files\Java\"

#2 - Created a directory at the root of my HP 720 called "\Classes"

#3 - Followed the directions on the site to create two .jar files named
javac.jar and missing.jar. Nothing scientific about this, I just followed
the directions.

    So these classes....

sun/tools/asm/*.class
sun/tools/java/*.class
sun/tools/javac/*.class
sun/tools/javac/resources/javac.properties
sun/tools/tree/*.class

from the Java base source for the 1.1.8 JDK got wrapped into javac.jar. And
these classes...

java/awt/*.class
java/io/*.class
java/lang/*.class
java/net/*.class
java/security/*.class
java/text/*.class
java/util/*.class

got wrapped up into missing.jar.

#4 - Contrary to the directions I dropped both of these .jar files in
"\Storage Card\Program Files\Java\lib"

#5 - Worked a bit with a wrapper class similar to the one Frank (from the
site above) devised. What I came up with after a bit of trial and error is
really simple....

----------------------------------------------

public class Javac {
    public static void main(String argv[]) {
    String[] newargv = new String[1];
    newargv[0]=argv[0];

     sun.tools.javac.Main.main(newargv);
    }

Quote:}

-----------------------------------------------

#6 - Using the 1.1.8 JDK I compiled this into javac.class and dropped this
file under "\Classes"

#7 - Went to the command line of my Jornada 720 and used the following
command to run the class against a file also in the "\Classes" directory
entitled HelloWorld.java...

From the classes directory I typed....

"\Storage Card\Program Files\Java\bin\pjava.exe" -classpath "\Storage
Card\Program Files\Java\lib\missing.jar;\Storage Card\Program
Files\Java\lib\javac.jar" -file "\Classes\Javac.class" HelloWorld.java

#8 - Went into ChaiVM and ran "\Classes\HelloWorld.class" and it worked.

For some reason this compiled class doesn't run in Personal Java, or maybe
it's just that Personal Java's console doesn't work right and I can't see
the print out. Either way, ChaiVM showed me that my journey was complete.

Now obviously you can see above that this isn't perfect. I need to find out
how to dynamically set the classpaths and it would be nice if I could get
Personal Java to show the System.out.println()s but all the same I'm able to
compile and run java from under Windows CE. Pretty strange, pretty cool and
it's going to be fun using this for my class. If anyone wants further help,
is curious to try or runs into problems feel free to email me. I can't
promise anything, since I just did it, but I'll try.

Preston

 
 
 

Programming java under Windows CE.. yet again...

Post by Preston Crawfor » Sun, 08 Jul 2001 09:50:56


Oh, and there is an annoying bug in the Personal Java install, so if anyone
tries this, look at this link...

http://groups.google.com/groups?q=pjava.exe.old&hl=en&safe=off&rnum=1...
elm=9h9ob7%24n8i%241%40news.brutele.be

Preston