View Full Version : JamVM, Classpath, and Jikes for the 2006 OS
aleksandyr
08-24-2006, 11:39 AM
Screenshots forthcoming: for now, I'm just happy it works.
http://alexander.lash.googlepages.com/classpath_0.91-1_armel.deb
http://alexander.lash.googlepages.com/jamvm_1.4.3-1_armel.deb
Optional:
http://alexander.lash.googlepages.com/jikes_1.22-1_armel.deb
Example app I used:
http://alexander.lash.googlepages.com/AWTExample.java
Enjoy.
frethop
08-24-2006, 07:40 PM
Very Cool! Thanks for putting these pieces together.
However... When I try to install each, I get error messages:
Unable to install.
Incompatible package.
I'm running OS 2006 and tried to install the packages from your links.
Sorry. :confused:
-F
aleksandyr
08-24-2006, 08:03 PM
Oops. Never tried Application Installer.
As root, you'll need to dpkg -i each one.
These are my first real .debs --- expect some major improvements over the weekend!
Wesley
08-25-2006, 07:47 PM
Works! Great job!
bradb
08-26-2006, 02:36 AM
Oops. Never tried Application Installer.
As root, you'll need to dpkg -i each one.
Great work, but ugh - dpkg?
Your problem is the the package section is wrong, check out this (http://maemo.org/platform/docs/howtos/howto_making_an_application_package.html#sections) .
Brad.
mike9285
08-26-2006, 01:21 PM
I can install the jikes and jamvm packages just fine. When I try to install the classpath package I get dependency problems saying libice6 is not configured, libsm6 is not configured, and xlibs isn't installed yet. Does anyone know where I can find this missing library?
aleksandyr
08-27-2006, 01:36 AM
Whoops. Assumed everyone has minimo =)
Check their repo for the libs.
Currently in airport waiting with my 770 =) thanks for link will fix packages when I get home.
mallard
08-27-2006, 07:57 PM
Whenever I try to run anything I get:
Exception occurred while VM initialising.
java/lang/NoClassDefFoundError: java/lang/Thread
Also, seeng as the packages don't show up in Application Manager even after installation, how would I uninstall it?
konttori
08-28-2006, 02:43 AM
dpkg -u <packagename> will uninstall.
I'm eagerly waiting to try this out today. My computer crashed last wednesday and I've been in recovery mode ever since.
aleksandyr
08-28-2006, 04:27 PM
The java/lang/Thread exception tends to mean that none of the libraries were found/readable.
Not sure what to advise besides a reinstall at this point.
mallard
08-29-2006, 12:45 AM
Ok, well I found that dpkg -u doesn't work, but dpkg -r does. I have reinstalled all the packages, but still no go.
Can someone give me the exact command line they use to start a java app? Having used Java on other platforms, I think I need to give it a CLASSPATH for it to find the default classes, what is the correct CLASSPATH for this set-up?
aflegg
11-27-2006, 07:21 AM
OK, once you've got it installed, here are the commands to get it working:
$ export PATH=/usr/local/bin:$PATH
$ export CLASSPATH=/usr/local/classpath/share/classpath/glibj.zip:.
$ jikes AWTExample.java (http://www.idevelopment.info/data/Programming/java/swing/AWTExample.java)
$ jamvm AWTExample
Note that I've linked to a different version of AWTExample.java - the one alongside the JamVM debs has some formatting issues (easily fixed, but this version has them already).
HTH,
Andrew
aflegg
12-01-2006, 08:04 PM
Screenshots forthcoming: for now, I'm just happy it works.
<snip />
Enjoy.
Excellent work.
From a quick look at the Classpath source code it looks like it should be trivial to Hildonise all AWT applications (at least) automatically.
The main things which need to be done are:
HildonWindows rather than GtkWindows (completes the border to the right of the window)
Setting menus on the window, rather than adding menubars.
The first is straight-forward in native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c?rev=1.71&root=classpath&view=log), changing gtk_window_new() in _create() to hildon_window_new(). Example in Sylpeed (http://badger.bleb.org/cgi-bin/viewvc.cgi/bleb/sylpheed/trunk/src/addressadd.c?r1=45&r2=52)
The second is also straight-forward in native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c (http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c?rev=1.12&root=classpath&view=log) in the *MenuBar() functions, mapping them to their HildonWindow equivalents.
I've got code in Sylpheed (http://badger.bleb.org/cgi-bin/viewvc.cgi/bleb/sylpheed/trunk/src/menu.c?r1=45&r2=52) for taking a Gtk-style menu bar and turning it into a normal GtkMenu which can be used in hildon_window_set_menu().
Is the package source you used to build Classpath available? If so, I'd be happy to try and make these changes myself.
Thanks in advance,
Andrew
aleksandyr
12-03-2006, 11:24 AM
Sorry about the delayed reply.
Just a copy of GNU Classpath's source, very lightly tweaked and crosscompiled in Scratchbox. My linux partition is refusing to boot at the moment: I'll try to extract the source at some point soon --- but really, Classpath was the easy part ;)
Is JamVM more lightweight or easially portable than Kaffe JVM. It looks like Kaffe runs on IPAQ linux
ddalex
01-16-2007, 11:36 AM
I'm trying to port a custom implementation of J2ME over J2SE to the 770. Unfortunately, starting it with jamvm/classpath 0.91 crashes in the classpath with this error:
[Loaded java/util/logging/SimpleFormatter from /usr/local/classpath/share/classpath/glibj.zip]
[Linking class java/util/logging/SimpleFormatter]
[Created array class [Ljava/util/logging/SimpleFormatter;]
Exception occurred while VM initialising.
java/lang/NullPointerException
Any ideas what to do ? I'm thinking to try and use the classpath-0.93. Does anyone know what version of gtk does scirocco have ? The mistral version I'm using right now has gtk 2.6 which limits me to classpath-0.91.
aleksandyr
01-17-2007, 05:58 AM
Is JamVM more lightweight or easially portable than Kaffe JVM. It looks like Kaffe runs on IPAQ linux
Yes and yes. Kaffe doesn't compile in scratchbox (yet) and I haven't thrown any cycles at the problem, since Mika and PhoneME came about.
aleksandyr
01-26-2007, 02:17 PM
It's been some time since I revisited these problems, and I figure I owe an update by now ;)
I have abandoned JamVM since it has no JIT. I will be recompiling it against the newest SDK, but it's a dead-end as far as usable Java on ITOS --- extremely useful for testing, however!
I am currently researching Kaffe and Cacao as JIT+JVM solutions. I found out that a Cacao developer managed to get Cacao working on OS2005: however, the ARM optimizations appear to be closed-source and therefore I am not yet able to duplicate this success.
PhoneME lacks a GTK peer, and I lack the GTK knowledge to put one together: furthermore, far more experienced coders appear to be working on this. Classpath, on the other hand, has a GTK+Cairo peer that already works on the 770 and is, as Aflegg notes, quite hildonizable: both Kaffe and Cacao work with Classpath.
For those interested in J2ME support, I recommend http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedPlatformsNokia770
Jikes appears to be suitable for the time being.
Finally, I was able to secure a developer code, and will therefore be supporting the 800 in future endeavors as well as the 770: I promise to make a best-effort attempt to ensure anything I release functions on both platforms.
Here are my current plans:
0) Release fresh AbiWord packages for the 800.
1) Experiment with the new 3.0 SDK.
2) Experiment with the release of PhoneME for the 770.
3) Recompile JamVM/Classpath/Jikes for the latest SDKs: implement basic Classpath hildonization.
4) Get Cacao working (if possible: otherwise, renew Kaffe efforts)
anidel
02-09-2007, 07:23 AM
Hallo guys,
I have repackaged the .deb files so that this Java VM and compiler for Java 1.4 work also on the Nokia N800.
If you guys wish, with permission of the author of course, I can upload it to the maemo downloads (http://downloads.maemo.org)
I will provide links to them asap anyway.
--
anidel
aflegg
02-09-2007, 07:40 AM
anidel: did you do any recompilation? Include any auto-Hildonisation for AWT?
I've not yet got a working version of the Classpath source tree to get it a shot.
anidel
02-09-2007, 07:51 AM
No I didn't do it.
I just fixed the control file for the .deb in order to have the .debs file install on the N800.
Actually I would like to look at the source code for jikes or/and jamvm and classpath as I think there is a bug somewhere.
My Java program (compiled on the Mac with Java1.4.2) does work on the Mac, but when I move it to the N800/770 it fails.
I make heavy use of BigIntegers and it fails to compute a modPow.
--
anidel
anidel
02-09-2007, 08:16 AM
Actually the problem may be that the .class files, generated with the standard JavaVM from Sun (1.4.2) ARE NOT fully compatible with JamVM.
I am investigating this more. (trying to compile everything with jikes)
riderman
08-03-2008, 09:27 AM
Hi,
thanks a lot for this thread, now I`m able to run my java-applications on the nokia 770. The only bad thing is entering the two lines every time:
$ export PATH=/usr/local/bin:$PATH
$ export CLASSPATH=/usr/local/classpath/share/classpath/glibj.zip:.
Is there a possibility to store them somewhere so that thig gets done automatic ?
I tried to insert the Lines into the .bashrc and the /etc/profiles - the .bashrc creates an error and the /etc/profiles crashed my device... Now i thought I ask before I have to set it up once again :)
Can someone please help?
ebrindle
08-03-2008, 10:10 AM
Try placing the environment variables and your java command line in a shell script file.
Its worked for me in the past on other unixes...
riderman
08-03-2008, 11:06 AM
Okay, now I made a file j.sh with this content:
#!/bin/bash
export PATH=/usr/local/bin:$PATH
export CLASSPATH=/usr/local/classpath/share/classpath/glibj.zip:.
when I run it with
sh j.sh
I get
: not found
: not found
So there is no possibility to store the variables in some configuration file so that they are known allredy on startup of XTerm?
If I login with SSH I don`t even have to enter these lines and it works. I think thats because the SSh Window is a login-shell and the XTerm Window on the device isn`t.
I've gotten a bit lost trying to understand the current status in this thread. I'd sure love to run certain Java programs on my tablet.
Are you guys saying it IS possible to run a (v1.4 at least) JAR program, as long as its AWT or SWT and not Swing (which a ton of apps use), and have a JVM (which one? depends on the app I assume) installed?
aleksandyr - do we first need to re-compile with this Jikes compiler instead of javac for some reason?
(grumble grumble, what's the problem with using Swing anyway?)
saleum
02-13-2009, 10:07 PM
Java works perfectly well on the 810. The only thing to do is to install the package of the Jalimo example and if one wants graphics or windows, then the SWT Jalimo example.
The files can be compiled in a standard OS (Linux ?) including the eclipse SWT libraries, with the SUN javac (I use 1.5.0)
Everything works fine and the only limitations are the result of the limited SWT included in Jalimo.
What I don't know how to do is to compile IN the 810 as I don't find any compiler.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.