Re: SableVM on ARM fails to run HelloWorld

"Grzegorz B. Prokopski" <[email protected]> Wed, 23 Nov 2005 12:01:31 -0500
Newsgroups gmane.comp.java.vm.sablevm.general
Organization SableVM Project http://sablevm.org
Message-ID <20051123170130.GI9502@gadek>
Hi Chris,

+++ Chris Develder [23/11/05 12:11 +0100]:
> Hi,
> 
> Being a SableVM newbie, I have trouble in getting a cross-compiled 
> sablevm to work.
> 
> I compiled sablevm-1.12:
> ./configure --host=arm-linux 
> --prefix=/work/cdvelder/xscale/usr/local/sablevm-1.12 
> --with-threading=direct --with-debugging-features
> 
> And sablevm-classpath-1.22: (using jikes-1.22)
> ./configure --host=arm-linux 
> --prefix=/work/cdvelder/xscale/usr/local/sablevm-1.12 --disable-gtk-peer 
> --disable-qt-peer --enable-debug --with-jikes

Looks good to me.

> Upon moving it to the target device, running
> # sablevm HelloWorld
> produces:
> java.lang.ClassFormatError
>    at java.lang.VMClassLoader.nativeDefineClass (VMClassLoader.java)
>    at java.lang.VMClassLoader.defineClass (VMClassLoader.java:92)
>    at java.lang.ClassLoader.defineClass (ClassLoader.java:677)
>    at java.security.SecureClassLoader.defineClass 
> (SecureClassLoader.java:108)
>    at java.net.URLClassLoader.findClass (URLClassLoader.java:926)
>    at java.lang.ClassLoader.loadClass (ClassLoader.java:358)
>    at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1297)
>    at java.lang.ClassLoader.loadClass (ClassLoader.java:309)
>    at java.lang.VirtualMachine.main (VirtualMachine.java:99)

Usually the first test we do is to make sure it bootstraps properly w/o
running any user code.  You can do it with something like:

	sablevm -Y blah

This should tell you that class 'blah' couldn't be found.

> The HelloWorld.class was generated using Jikes on my build machine. I 
> couldn't rebuild it on the target because javac-sablevm is an empty file.

Weird that is it empty.  But if you have jikes installed on the target
machine you can always do:

export BOOTCLASSPATH=/work/cdvelder/xscale/usr/local/sablevm-1.12/share/sablevm-classpath/libclasspath.jar
and then use 'jikes HelloWorld.java' to compile the source.

Make sure the path you give in --prefix is *identical* on the machine you use
for cross-compilation and on the device you later copy installed sablevm to.

Also make sure your class files (HelloWorld in your case) are compiled for
java 1.4 format.  We don't support java 1.5 format just yet.

Let us know of your findings.  There's a few people on this list that used
SableVM in embedded environments so maybe they can give a better advice.

Cheers,

		Grzegorz B. Prokopski

-- 
Grzegorz B. Prokopski      <[email protected]>
Debian GNU/Linux           http://www.debian.org
SableVM - LGPL'ed Java VM  http://www.sablevm.org
Why SableVM ?!?            http://devel.sablevm.org/wiki/Features