Hello,

I have a little embedded system (armv5) with Linux on it, along with JamVM. It has this little limitation where I cannot run Jars, so I wrote a little workaround...


#!/bin/ash
rm /mnt/user/tmp/* -rf
if [ $1 = "-jar" ]; then
unzip $2 -d /mnt/user/tmp
cd /mnt/user/tmp
main_class="$(cat META-INF/MANIFEST.MF | grep 'Main-Class' | sed 's/.*Main-Class:\(.*\)*/\1/' | sed 's/ //g')"
/mnt/user/jvm/java $main_class
else
LD_LIBRARY_PATH=/mnt/user/lib /mnt/user/jvm/jamvm -mx8M -cp /mnt/user/jvm/cbc:./ -Xbootclasspath:/mnt/user/lib/classes.zip:/mnt/user/lib/glibj.zip -DCBC $1
fi

The problem is, this gives me a java.lang.NoClassDefFoundError: Main error, when if i replace $main_class with Main, it works without an issue. $main_class does seem to be "Main" but for some reason, this is not working.

Any ideas?

Thanks!
(also, i apologize for the ugly grep and sed things... i dont' have much experience with either....)